rest-snap 0.1.17.11 → 0.1.17.12
raw patch · 3 files changed
+7/−13 lines, 3 filesdep −containersdep −fclabelsdep −hxtdep ~rest-core
Dependencies removed: containers, fclabels, hxt, json-schema, mtl, regular-xmlpickler, rest-types, split, text, transformers
Dependency ranges changed: rest-core
Files
- CHANGELOG.md +4/−0
- rest-snap.cabal +2/−12
- src/Rest/Driver/Snap.hs +1/−1
CHANGELOG.md view
@@ -1,5 +1,9 @@ # Changelog +#### 0.1.17.12++* Ignore empty path segments in URLs+ #### 0.1.17.11 * Use `json-schema 0.5.*`
rest-snap.cabal view
@@ -1,5 +1,5 @@ name: rest-snap-version: 0.1.17.11+version: 0.1.17.12 description: Rest driver for Snap. synopsis: Rest driver for Snap. maintainer: code@silk.co@@ -25,19 +25,9 @@ base == 4.* , bytestring >= 0.9 && < 0.11 , case-insensitive >= 0.4 && < 1.3- , containers >= 0.4 && < 0.6- , fclabels == 2.0.*- , hxt >= 9.2 && < 9.4- , json-schema == 0.5.*- , mtl >= 2.0 && < 2.3- , regular-xmlpickler == 0.2.*- , rest-core >= 0.28 && < 0.31- , rest-types == 1.10.*+ , rest-core == 0.31.* , safe >= 0.2 && < 0.4 , snap-core == 0.9.*- , split >= 0.1 && < 0.3- , text >= 0.11 && < 1.2- , transformers >= 0.3 && < 0.5 , unordered-containers == 0.2.* , uri-encode == 1.5.* , utf8-string == 0.3.*
src/Rest/Driver/Snap.hs view
@@ -31,7 +31,7 @@ getParameter nm = getsRequest (fmap UTF8.toString . (>>= headMay) . rqParam (UTF8.fromString nm)) getBody = readRequestBody (1 * 1024 * 1024) getMethod = getsRequest (toRestMethod . rqMethod)- getPaths = getsRequest (map (UTF8.toString . URI.decodeByteString) . Char8.split '/' . rqPathInfo)+ getPaths = getsRequest (map (UTF8.toString . URI.decodeByteString) . filter (not . Char8.null) . Char8.split '/' . rqPathInfo) lookupMimeType = return . fmap UTF8.toString . flip M.lookup defaultMimeTypes setHeader nm v = modifyResponse (Snap.setHeader (CI.mk . UTF8.fromString $ nm) (UTF8.fromString v)) setResponseCode cd = modifyResponse (Snap.setResponseCode cd)