diff --git a/snap-core.cabal b/snap-core.cabal index ccedb324..a7e8e53e 100644 --- a/snap-core.cabal +++ b/snap-core.cabal @@ -151,7 +151,8 @@ Library unix-compat >= 0.2 && < 0.5, unordered-containers >= 0.1.4.3 && < 0.3, vector >= 0.6 && < 0.11, - zlib-enum >= 0.2.1 && < 0.3 + zlib-enum >= 0.2.1 && < 0.3, + system-filepath == 0.4.* extensions: BangPatterns, diff --git a/src/Snap/Internal/Parsing.hs b/src/Snap/Internal/Parsing.hs index 6a03adae..be67e34f 100644 --- a/src/Snap/Internal/Parsing.hs +++ b/src/Snap/Internal/Parsing.hs @@ -161,7 +161,7 @@ pQuotedString = q *> quotedText <* q , pure soFar' ] q = char '\"' - qdtext = matchAll [ isRFCText, (/= '\"'), (/= '\\') ] + qdtext = matchAll [ (/= '\"'), (/= '\\') ] ------------------------------------------------------------------------------ diff --git a/src/Snap/Util/FileServe.hs b/src/Snap/Util/FileServe.hs index 6859aa20..c28a9644 100644 --- a/src/Snap/Util/FileServe.hs +++ b/src/Snap/Util/FileServe.hs @@ -53,6 +53,7 @@ import qualified Prelude import System.Directory import System.FilePath import System.PosixCompat.Files +import qualified Filesystem.Path.CurrentOS as FP ------------------------------------------------------------------------------ import Snap.Core import Snap.Internal.Debug @@ -69,7 +70,7 @@ getSafePath = do req <- getRequest let mp = urlDecode $ rqPathInfo req - p <- maybe pass (return . S.unpack) mp + p <- maybe pass (return . FP.encodeString . FP.decode) mp -- relative paths only! when (not $ isRelative p) pass