packages feed

yesod-static 1.5.0.5 → 1.5.1

raw patch · 3 files changed

+16/−3 lines, 3 filesdep +exceptions

Dependencies added: exceptions

Files

ChangeLog.md view
@@ -1,3 +1,7 @@+## 1.5.1++* yesod-static doesn't obey Authentication [#1286](https://github.com/yesodweb/yesod/issues/1286)+ ## 1.5.0.5  * Avoid lazy I/O in mkEmbeddedStatic (fixes [#149](https://github.com/yesodweb/yesod/issues/149))
Yesod/Static.hs view
@@ -6,6 +6,7 @@ {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE FlexibleContexts #-} --------------------------------------------------------- -- -- | Serve static files from a Yesod app.@@ -74,6 +75,7 @@  import Crypto.Hash.Conduit (hashFile, sinkHash) import Crypto.Hash (MD5, Digest)+import Control.Monad.Catch (MonadThrow) import Control.Monad.Trans.State  import qualified Data.Byteable as Byteable@@ -102,6 +104,7 @@ import Data.Default --import Text.Lucius (luciusRTMinified) +import Network.Wai (pathInfo) import Network.Wai.Application.Static     ( StaticSettings (..)     , staticApp@@ -170,11 +173,16 @@ instance ParseRoute Static where     parseRoute (x, y) = Just $ StaticRoute x y -instance YesodSubDispatch Static m where+instance (MonadThrow m, MonadIO m, MonadBaseControl IO m)+  => YesodSubDispatch Static (HandlerT master m) where     yesodSubDispatch YesodSubRunnerEnv {..} req =-        staticApp set req+        ysreParentRunner base ysreParentEnv (fmap ysreToParentRoute route) req       where+        base = stripHandlerT handlert ysreGetSub ysreToParentRoute route+        route = Just $ StaticRoute (pathInfo req) []+         Static set = ysreGetSub $ yreSite $ ysreParentEnv+        handlert = sendWaiApplication $ staticApp set  notHidden :: FilePath -> Bool notHidden "tmp" = False
yesod-static.cabal view
@@ -1,5 +1,5 @@ name:            yesod-static-version:         1.5.0.5+version:         1.5.1 license:         MIT license-file:    LICENSE author:          Michael Snoyman <michael@snoyman.com>@@ -59,6 +59,7 @@                    , blaze-builder         >= 0.3                    , css-text              >= 0.1.2                    , hashable              >= 1.1+                   , exceptions      exposed-modules: Yesod.Static                      Yesod.EmbeddedStatic