packages feed

wai-middleware-static 0.5.0.1 → 0.6.0

raw patch · 3 files changed

+17/−12 lines, 3 filesdep ~waiPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: wai

API changes (from Hackage documentation)

Files

Network/Wai/Middleware/Static.hs view
@@ -125,18 +125,18 @@ staticPolicy :: Policy -> Middleware staticPolicy p = unsafeStaticPolicy $ noDots >-> isNotAbsolute >-> p --- | Serve static files subject to a 'Policy'. Unlike 'static' and 'staticPolicy', this +-- | Serve static files subject to a 'Policy'. Unlike 'static' and 'staticPolicy', this -- has no policies enabled by default, and is hence insecure. unsafeStaticPolicy :: Policy -> Middleware-unsafeStaticPolicy p app req =-    maybe (app req)+unsafeStaticPolicy p app req callback =+    maybe (app req callback)           (\fp -> do exists <- liftIO $ doesFileExist fp                      if exists-                        then return $ responseFile status200-                                                   [("Content-Type", getMimeType fp)]-                                                   fp-                                                   Nothing-                        else app req)+                        then callback $ responseFile status200+                                                     [("Content-Type", getMimeType fp)]+                                                     fp+                                                     Nothing+                        else app req callback)           (tryPolicy p $ T.unpack $ T.intercalate "/" $ pathInfo req)  type Ascii = B.ByteString
changelog.md view
@@ -1,9 +1,14 @@+## 0.6.0++* Update to wai 3.0+ ## 0.5.0.1- * Bump upper bound for `mtl` +* Bump upper bound for `mtl`+ ## 0.5.0.0 -* Add `isNotAbsolute` policy and change `static` and `staticPolicy` to +* Add `isNotAbsolute` policy and change `static` and `staticPolicy` to   use `noDots` and `isNotAbsolute` policies by default. (Thanks to Nick Hibberd!)  * Add `unsafeStaticPolicy`, which behaves as the old insecure `staticPolicy` behaved.
wai-middleware-static.cabal view
@@ -1,5 +1,5 @@ Name:                wai-middleware-static-Version:             0.5.0.1+Version:             0.6.0 Synopsis:            WAI middleware that serves requests to static files. Homepage:            https://github.com/scotty-web/scotty Bug-reports:         https://github.com/scotty-web/scotty/issues@@ -31,7 +31,7 @@                        http-types       >= 0.8.2    && < 0.9,                        mtl              >= 2.1.2    && < 2.3,                        text             >= 0.11.3.1 && < 1.2,-                       wai              >= 2.0.0    && < 2.2+                       wai              >= 3.0.0    && < 3.1    GHC-options: -Wall -fno-warn-orphans