wai-middleware-static 0.0.1 → 0.1.0
raw patch · 2 files changed
+4/−6 lines, 2 filesdep ~basedep ~bytestringdep ~containersPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: base, bytestring, containers, directory, http-types, mtl, system-filepath, text, wai
API changes (from Hackage documentation)
Files
Network/Wai/Middleware/Static.hs view
@@ -26,7 +26,7 @@ -- > static = staticRoot "" staticRoot :: T.Text -> Middleware staticRoot base app req =- if ".." `isInfixOf` fStr+ if ".." `isInfixOf` (F.encodeString fp) -- for security reasons then app req else do exists <- liftIO $ doesFileExist fStr if exists@@ -40,13 +40,11 @@ where go [] = defaultMimeType go exts = fromMaybe (go $ tail exts) $ M.lookup (B.intercalate "." exts) defaultMimeTypes -type MimeMap = M.Map B.ByteString B.ByteString- defaultMimeType :: B.ByteString defaultMimeType = "application/octet-stream" -- This list taken from snap-core's Snap.Util.FileServe-defaultMimeTypes :: MimeMap+defaultMimeTypes :: M.Map B.ByteString B.ByteString defaultMimeTypes = M.fromList [ ( "asc" , "text/plain" ), ( "asf" , "video/x-ms-asf" ),
wai-middleware-static.cabal view
@@ -1,5 +1,5 @@ Name: wai-middleware-static-Version: 0.0.1+Version: 0.1.0 Synopsis: WAI middleware that intercepts requests to static files. Homepage: https://github.com/xich/scotty Bug-reports: https://github.com/xich/scotty/issues@@ -27,7 +27,7 @@ bytestring >= 0.9.1, containers >= 0.4, directory >= 1.1,- http-types >= 0.6.8,+ http-types >= 0.6.8 && < 0.7, mtl >= 2.0.1, system-filepath >= 0.4.4, text >= 0.11.1,