@@ -7,11 +7,6 @@ module WaiAppStatic.Types
77 , unsafeToPiece
88 , Pieces
99 , toPieces
10− , pieceExtensions
11− -- * Mime
12− , MimeType
13− , Extension
14− , MimeMap
1510 -- * Caching
1611 , MaxAge (..)
1712 -- * File\/folder serving
@@ -30,8 +25,8 @@ import qualified Network.Wai as W
3025import Data.ByteString (ByteString)
3126import System.Posix.Types (EpochTime)
3227import qualified Data.Text as T
33−import qualified Data.Map as Map
3428import Blaze.ByteString.Builder (Builder)
29+import Network.Mime (MimeType)
3530
3631-- | An individual component of a path, or of a filepath.
3732--
@@ -67,19 +62,6 @@ toPieces = mapM toPiece
6762-- | Request coming from a user. Corresponds to @pathInfo@.
6863type Pieces = [Piece]
6964
70−-- | Get a list of all of the file name extensions from a piece.
71−--
72−-- > pieceExtensions (unsafeToPiece "foo.tar.gz") == ["tar.gz", "gz"]
73−pieceExtensions :: Piece -> [Extension]
74−pieceExtensions =
75− go . fromPiece
76− where
77− go t
78− | T.null e = []
79− | otherwise = e : go e
80− where
81− e = T.drop 1 $ T.dropWhile (/= '.') t
82−
8365-- | Values for the max-age component of the cache-control response header.
8466data MaxAge = NoMaxAge -- ^ no cache-control set
8567 | MaxAgeSeconds Int -- ^ set to the given number of seconds
@@ -121,15 +103,6 @@ data LookupResult = LRFile File
121103-- the resulting folder.
122104type Listing = Pieces -> Folder -> IO Builder
123105
124−-- | Individual mime type for be served over the wire.
125−type MimeType = ByteString
126−
127−-- | Path extension. May include multiple components, e.g. tar.gz
128−type Extension = Text
129−
130−-- | Maps extensions to mime types.
131−type MimeMap = Map.Map Extension MimeType
132−
133106-- | All of the settings available to users for tweaking wai-app-static.
134107--
135108-- Note that you should use the settings type approach for modifying values.