on master help sign in
Merge branch 'maintain/1.4'

Conflicts: wai-app-static/wai-app-static.cabal

commit9a715a75f1458d9e76c32bd55e7cf2b83d13d3a8 authorMichael Snoyman <michael@snoyman.com> dateTue 10 Dec 2013, 09:02 (13 years ago) parent3b1a418821d7e4
2 files changed+8−2
wai-app-static/WaiAppStatic/Storage/Embedded/Runtime.hs+6−1 wai-app-static/wai-app-static.cabal+2−1
wai-app-static/WaiAppStatic/Storage/Embedded/Runtime.hs+6−1
@@ -19,6 +19,7 @@ import qualified Crypto.Classes as CR
1919import Crypto.Hash.CryptoAPI (hash', MD5)
2020import qualified Data.ByteString.Base64 as B64
2121import WaiAppStatic.Storage.Filesystem (defaultFileServerSettings)
22+import System.FilePath (pathSeparator)
2223
2324-- | Serve the list of path/content pairs directly from memory.
2425embeddedSettings :: [(Prelude.FilePath, ByteString)] -> StaticSettings
@@ -63,7 +64,11 @@ toEmbedded fps =
6364 texts = map (\(x, y) -> (filter (not . T.null . fromPiece) $ toPieces' x, y)) fps
6465 toPieces' "" = []
6566 toPieces' x =
66− let (y, z) = break (== '/') x
67+ -- See https://github.com/yesodweb/yesod/issues/626
68+ --
69+ -- We want to separate on the forward slash on *all* OSes, and on
70+ -- Windows, also separate on a backslash.
71+ let (y, z) = break (\c -> c == '/' || c == pathSeparator) x
6772 in unsafeToPiece (T.pack y) : toPieces' (drop 1 z)
6873
6974 go :: [(Pieces, ByteString)] -> Embedded
wai-app-static/wai-app-static.cabal+2−1
@@ -1,5 +1,5 @@
11name: wai-app-static
2−version: 2.0.0
2+version: 2.0.0.1
33license: MIT
44license-file: LICENSE
55author: Michael Snoyman <michael@snoyman.com>
@@ -50,6 +50,7 @@ library
5050 , unordered-containers >= 0.2
5151 , template-haskell >= 2.7
5252 , zlib >= 0.5
53+ , filepath
5354
5455 exposed-modules: Network.Wai.Application.Static
5556 WaiAppStatic.Storage.Filesystem