@@ -30,6 +30,7 @@ module Network.Wai.Application.Static
31 , pathFromPieces
31 , pathFromPieces
32 , unfixPathName
32 , unfixPathName
33 -- ** Directory listings
34 -- ** Directory listings
35 , defaultListing
36 , defaultListing
@@ -489,11 +490,11 @@ toEmbedded fps =
491 texts = map (\(x, y) -> (filter (not . T.null) $ toPieces x, y)) fps
492 texts = map (\(x, y) -> (filter (not . T.null) $ toPieces x, y)) fps
492− toPiece fp = T.pack $ fixPathName fp
493+ toPiece' fp = T.pack $ fixPathName fp
493 toPieces "" = []
494 toPieces "" = []
494 toPieces x =
495 toPieces x =
495 let (y, z) = break (== '/') x
496 let (y, z) = break (== '/') x
496− in toPiece y : toPieces (drop 1 z)
497+ in toPiece' y : toPieces (drop 1 z)
497 go :: [([T.Text], S8.ByteString)] -> Embedded
498 go :: [([T.Text], S8.ByteString)] -> Embedded
498 go orig =
499 go orig =
499 Map.fromList $ map (second go') hoisted
500 Map.fromList $ map (second go') hoisted
@@ -523,13 +524,13 @@ runHashL :: L.ByteString -> ByteString
523runHashL = B64.encode . MD5.hashlazy
524runHashL = B64.encode . MD5.hashlazy
525staticApp :: StaticSettings -> W.Application
526staticApp :: StaticSettings -> W.Application
527− staticAppPieces set (map toPiece $ W.pathInfo req) req
527+staticApp set req = staticAppPieces set (map toPiece $ W.pathInfo req) req
529− toPiece t = Piece
529+toPiece :: T.Text -> Piece
530− { piecePretty = t
531+ { piecePretty = t
531− , pieceRaw = unfixPathName $ T.unpack t
532+ , pieceRaw = unfixPathName $ T.unpack t
534status304, statusNotModified :: H.Status
535status304, statusNotModified :: H.Status
535status304 = H.Status 304 "Not Modified"
536status304 = H.Status 304 "Not Modified"