diff --git a/changelog.d/1584 b/changelog.d/1584 new file mode 100644 index 000000000..8ecba5890 --- /dev/null +++ b/changelog.d/1584 @@ -0,0 +1,10 @@ +synopsis: Escape special chars in QueryParams. +prs: #1597 +issues: #1584 + +description: { + +Escape special chars in QueryParam (':@&=+$') in servant-client. Note that this +mean binary data will not work as is, and so reverts the functionality in #1432. + +} diff --git a/servant-client/test/Servant/SuccessSpec.hs b/servant-client/test/Servant/SuccessSpec.hs index d0866084e..3edfc4218 100644 --- a/servant-client/test/Servant/SuccessSpec.hs +++ b/servant-client/test/Servant/SuccessSpec.hs @@ -101,11 +101,6 @@ successSpec = beforeAll (startWaiApp server) $ afterAll endWaiApp $ do Left (FailureResponse _ r) <- runClient (getQueryParam (Just "bob")) baseUrl responseStatusCode r `shouldBe` HTTP.Status 400 "bob not found" - it "Servant.API.QueryParam binary data" $ \(_, baseUrl) -> do - let payload = BS.pack [0, 1, 2, 4, 8, 16, 32, 64, 128] - apiCall = getQueryParamBinary (Just $ UrlEncodedByteString payload) HTTP.methodGet - (show +++ responseBody) <$> runClient apiCall baseUrl `shouldReturn` Right (BL.fromStrict payload) - it "Servant.API.QueryParam.QueryParams" $ \(_, baseUrl) -> do left show <$> runClient (getQueryParams []) baseUrl `shouldReturn` Right [] left show <$> runClient (getQueryParams ["alice", "bob"]) baseUrl