git.iko.soy/typeable/http-api-data
on master help sign in
Merge pull request #75 from Tritlo/master
409923cNickolay Kudasov
http-api-data.cabal−1
@@ -51,7 +51,6 @@ library
51 , time >= 1.4.2 && < 1.9
51 , time >= 1.4.2 && < 1.9
52 , time-locale-compat >= 0.1.1.0 && < 0.2
52 , time-locale-compat >= 0.1.1.0 && < 0.2
53 , unordered-containers >= 0.2.6.0 && < 0.3
53 , unordered-containers >= 0.2.6.0 && < 0.3
54− , uri-bytestring >= 0.1.7 && < 0.4
55 , uuid-types >= 1.0.2 && <1.1
54 , uuid-types >= 1.0.2 && <1.1
56 if !impl(ghc >= 8.0)
55 if !impl(ghc >= 8.0)
57 build-depends: semigroups >= 0.16 && < 0.19
56 build-depends: semigroups >= 0.16 && < 0.19
src/Web/Internal/FormUrlEncoded.hs+3−3
@@ -60,7 +60,7 @@ import Numeric.Natural
60import GHC.Exts (IsList (..), Constraint)
60import GHC.Exts (IsList (..), Constraint)
61import GHC.Generics
61import GHC.Generics
62import GHC.TypeLits
62import GHC.TypeLits
63−import URI.ByteString (urlEncodeQuery, urlDecodeQuery)
63+import Network.HTTP.Types.URI (urlEncodeBuilder, urlDecode)
64
64
65import Web.Internal.HttpApiData
65import Web.Internal.HttpApiData
66
66
@@ -543,7 +543,7 @@ urlEncodeFormStable = urlEncodeParams . sortOn fst . toList
543urlEncodeParams :: [(Text, Text)] -> BSL.ByteString
543urlEncodeParams :: [(Text, Text)] -> BSL.ByteString
544urlEncodeParams = toLazyByteString . mconcat . intersperse (shortByteString "&") . map encodePair
544urlEncodeParams = toLazyByteString . mconcat . intersperse (shortByteString "&") . map encodePair
545 where
545 where
546− escape = urlEncodeQuery . Text.encodeUtf8
546+ escape = urlEncodeBuilder True . Text.encodeUtf8
547
547
548 encodePair (k, "") = escape k
548 encodePair (k, "") = escape k
549 encodePair (k, v) = escape k <> shortByteString "=" <> escape v
549 encodePair (k, v) = escape k <> shortByteString "=" <> escape v
@@ -590,7 +590,7 @@ urlDecodeParams bs = traverse parsePair pairs
590 where
590 where
591 pairs = map (BSL8.split '=') (BSL8.split '&' bs)
591 pairs = map (BSL8.split '=') (BSL8.split '&' bs)
592
592
593− unescape = Text.decodeUtf8With lenientDecode . urlDecodeQuery . BSL.toStrict
593+ unescape = Text.decodeUtf8With lenientDecode . urlDecode True . BSL.toStrict
594
594
595 parsePair p =
595 parsePair p =
596 case map unescape p of
596 case map unescape p of