packages feed

wai-middleware-static 0.8.0 → 0.8.1

raw patch · 5 files changed

+44/−14 lines, 5 filesdep +cryptonitedep +hpc-coverallsdep +memorydep −base16-bytestringdep −cryptohashdep ~basedep ~directorydep ~http-types

Dependencies added: cryptonite, hpc-coveralls, memory, semigroups, wai-middleware-static

Dependencies removed: base16-bytestring, cryptohash

Dependency ranges changed: base, directory, http-types, time

Files

Network/Wai/Middleware/Static.hs view
@@ -27,8 +27,9 @@ import Control.Monad.Trans (liftIO) import Data.List #if !(MIN_VERSION_base(4,8,0))-import Data.Monoid+import Data.Monoid (Monoid(..)) #endif+import Data.Semigroup (Semigroup(..)) import Data.Time import Data.Time.Clock.POSIX import Network.HTTP.Types (status200, status304)@@ -39,9 +40,10 @@ #if !(MIN_VERSION_time(1,5,0)) import System.Locale #endif-import qualified Crypto.Hash.SHA1 as SHA1+import Crypto.Hash.Algorithms+import Crypto.Hash+import Data.ByteArray.Encoding import qualified Data.ByteString as BS-import qualified Data.ByteString.Base16 as B16 import qualified Data.ByteString.Char8 as BSC import qualified Data.ByteString.Lazy as BSL import qualified Data.Text as T@@ -65,11 +67,16 @@    | CustomCaching (FileMeta -> RequestHeaders)  -- | Note:+--   '(<>)' == @>->@ (policy sequencing)+instance Semigroup Policy where+    p1 <> p2 = policy (maybe Nothing (tryPolicy p2) . tryPolicy p1)++-- | Note: --   'mempty' == @policy Just@ (the always accepting policy) --   'mappend' == @>->@ (policy sequencing) instance Monoid Policy where-    mempty = policy Just-    mappend p1 p2 = policy (maybe Nothing (tryPolicy p2) . tryPolicy p1)+    mempty  = policy Just+    mappend = (<>)  -- | Lift a function into a 'Policy' policy :: (String -> Maybe String) -> Policy@@ -82,7 +89,7 @@ -- | Sequence two policies. They are run from left to right. (Note: this is `mappend`) infixr 5 >-> (>->) :: Policy -> Policy -> Policy-(>->) = mappend+(>->) = (<>)  -- | Choose between two policies. If the first fails, run the second. infixr 4 <|>@@ -257,7 +264,7 @@        return $ FileMeta                 { fm_lastModified =                       BSC.pack $ formatTime defaultTimeLocale "%a, %d-%b-%Y %X %Z" mtime-                , fm_etag = B16.encode (SHA1.hashlazy ct)+                , fm_etag = convertToBase Base16 (hashlazy ct :: Digest SHA1)                 , fm_fileName = fp                 } 
+ README.md view
@@ -0,0 +1,3 @@+# wai-middleware-static [![Build Status](https://travis-ci.org/scotty-web/wai-middleware-static.svg)](https://travis-ci.org/scotty-web/wai-middleware-static)[![Coverage Status](https://coveralls.io/repos/scotty-web/wai-middleware-static/badge.png?branch=master)](https://coveralls.io/r/scotty-web/wai-middleware-static?branch=master)++WAI middleware that intercepts requests to static files and serves them if they exist.
changelog.md view
@@ -1,3 +1,8 @@+## 0.8.1+* Add `Semigroup Policy` instance+* Replace dependencies on `base16-bytestring` and `cryptohash` with the more+  modern `memory` and `cryptonite` packages, respectively [myfreeweb]+ ## 0.8.0 * The `mime-types` library is now used to lookup MIME types from extensions.   As a result, some extensions now map to different MIME types. They are:
+ test/Main.hs view
@@ -0,0 +1,4 @@+module Main (main) where++main :: IO ()+main = return ()
wai-middleware-static.cabal view
@@ -1,5 +1,5 @@ Name:                wai-middleware-static-Version:             0.8.0+Version:             0.8.1 Synopsis:            WAI middleware that serves requests to static files. Homepage:            https://github.com/scotty-web/wai-middleware-static Bug-reports:         https://github.com/scotty-web/wai-middleware-static/issues@@ -18,29 +18,40 @@   .   [WAI] <http://hackage.haskell.org/package/wai> -Extra-source-files:    changelog.md+Extra-source-files:    changelog.md, README.md  Library   Exposed-modules:     Network.Wai.Middleware.Static   default-language:    Haskell2010   Build-depends:                        base               >= 4.6.0.1  && < 5,-                       base16-bytestring  >= 0.1      && < 0.2,                        bytestring         >= 0.10.0.2 && < 0.11,                        containers         >= 0.5.0.0  && < 0.6,-                       cryptohash         >= 0.11     && < 0.12,+                       cryptonite         >= 0.10     && < 1.0,+                       memory             >= 0.10     && < 1.0,                        directory          >= 1.2.0.1  && < 1.3,                        expiring-cache-map >= 0.0.5    && < 0.1,                        filepath           >= 1.3.0.1  && < 1.5,-                       http-types         >= 0.8.2    && < 0.9,+                       http-types         >= 0.8.2    && < 0.10,                        mime-types         >= 0.1.0.3  && < 0.2,                        mtl                >= 2.1.2    && < 2.3,                        old-locale         >= 1.0      && < 1.1,+                       semigroups         >= 0.18     && < 1,                        text               >= 0.11.3.1 && < 1.3,-                       time               >= 1.4      && < 1.6,-                       wai                >= 3.0.0    && < 3.1+                       time               >= 1.4      && < 1.7,+                       wai                >= 3.0.0    && < 3.3    GHC-options: -Wall -fno-warn-orphans++test-suite hpc-coveralls-stub+  main-is:             Main.hs+  type:                exitcode-stdio-1.0+  default-language:    Haskell2010+  hs-source-dirs:      test+  build-depends:       base,+                       hpc-coveralls,+                       wai-middleware-static+  ghc-options:         -Wall  source-repository head   type:     git