wai-app-static 2.0.0 → 2.0.0.1
raw patch · 2 files changed
+8/−2 lines, 2 filesdep +filepath
Dependencies added: filepath
Files
WaiAppStatic/Storage/Embedded/Runtime.hs view
@@ -19,6 +19,7 @@ import Crypto.Hash.CryptoAPI (hash', MD5) import qualified Data.ByteString.Base64 as B64 import WaiAppStatic.Storage.Filesystem (defaultFileServerSettings)+import System.FilePath (pathSeparator) -- | Serve the list of path/content pairs directly from memory. embeddedSettings :: [(Prelude.FilePath, ByteString)] -> StaticSettings@@ -63,7 +64,11 @@ texts = map (\(x, y) -> (filter (not . T.null . fromPiece) $ toPieces' x, y)) fps toPieces' "" = [] toPieces' x =- let (y, z) = break (== '/') x+ -- See https://github.com/yesodweb/yesod/issues/626+ --+ -- We want to separate on the forward slash on *all* OSes, and on+ -- Windows, also separate on a backslash.+ let (y, z) = break (\c -> c == '/' || c == pathSeparator) x in unsafeToPiece (T.pack y) : toPieces' (drop 1 z) go :: [(Pieces, ByteString)] -> Embedded
wai-app-static.cabal view
@@ -1,5 +1,5 @@ name: wai-app-static-version: 2.0.0+version: 2.0.0.1 license: MIT license-file: LICENSE author: Michael Snoyman <michael@snoyman.com>@@ -50,6 +50,7 @@ , unordered-containers >= 0.2 , template-haskell >= 2.7 , zlib >= 0.5+ , filepath exposed-modules: Network.Wai.Application.Static WaiAppStatic.Storage.Filesystem