uri-bytestring 0.1.7 → 0.1.8
raw patch · 4 files changed
+22/−3 lines, 4 files
Files
- changelog.md +3/−0
- src/URI/ByteString/Internal.hs +1/−1
- test/URI/ByteStringTests.hs +14/−1
- uri-bytestring.cabal +4/−1
changelog.md view
@@ -1,3 +1,6 @@+0.1.8+* Fix bug where uri-encoded paths would not decode when parsed.+ 0.1.7 * Add bytestring serialization functions. This is a common use case and exporting these prevents the user from directly depending on
src/URI/ByteString/Internal.hs view
@@ -378,7 +378,7 @@ -- | Parses the path section of a url. Note that while this can take -- percent-encoded characters, it does not itself decode them while parsing. pathParser' :: (Parser ByteString -> Parser [ByteString]) -> URIParser ByteString-pathParser' repeatParser = (mconcat <$> repeatParser segmentParser) `orFailWith` MalformedPath+pathParser' repeatParser = (urlDecodeQuery . mconcat <$> repeatParser segmentParser) `orFailWith` MalformedPath where segmentParser = mconcat <$> sequence [string "/", A.takeWhile (inClass pchar)]
test/URI/ByteStringTests.hs view
@@ -102,7 +102,12 @@ "" (Query []) (Just "only-fragment")-+ , testParses "https://www.example.org/weird%20path" $+ URI (Scheme "https")+ (Just (Authority Nothing (Host "www.example.org") Nothing))+ "/weird path"+ (Query [])+ Nothing , parseTestURI strictURIParserOptions "http://www.example.org/." $ Right $ URI@@ -310,4 +315,12 @@ (Just "somefragment") let res = BB.toLazyByteString (serializeURI uri) res @?= "http://user:pass@www.example.org/?foo=bar#somefragment"+ , testCase "encodes decoded paths" $ do+ let uri = URI (Scheme "http")+ (Just (Authority Nothing (Host "www.example.org") Nothing))+ "/weird path"+ (Query [])+ Nothing+ let res = BB.toLazyByteString (serializeURI uri)+ res @?= "http://www.example.org/weird%20path" ]
uri-bytestring.cabal view
@@ -1,5 +1,5 @@ name: uri-bytestring-version: 0.1.7+version: 0.1.8 synopsis: Haskell URI parsing as ByteStrings description: uri-bytestring aims to be an RFC3986 compliant URI parser that uses efficient ByteStrings for parsing and representing the URI data. license: BSD3@@ -13,6 +13,9 @@ cabal-version: >=1.16 homepage: https://github.com/Soostone/uri-bytestring bug-reports: https://github.com/Soostone/uri-bytestring/issues+Tested-With: GHC == 7.6.3+ , GHC == 7.8.4+ , GHC == 7.10.1 extra-source-files: README.md CONTRIBUTING.md