network-minihttp-0.1: A very minimal webserver

Network.MiniHTTP.MimeTypesParse

Description

This module parses the etcmime.types file, commonly found on UNIX systems. This file provides a mapping from file extension to MIME type.

Synopsis

Documentation

parseMimeTypes :: String -> IO (Map ByteString MediaType)Source

Parse the given filename as a mime.types file and return a map from file extension to mime type.

parseMimeTypesTotal :: String -> IO (Maybe (Map ByteString MediaType))Source

Same as parseMimeTypes, but never throw an exception, return a Nothing instead.