Protect unicode values in requests

This commit is contained in:
Joe Nelson
2016-03-13 14:20:54 -07:00
parent 1037824e11
commit 330cc91645
3 changed files with 45 additions and 18 deletions
+5 -1
View File
@@ -390,11 +390,15 @@ spec = do
post "/rpc/test_empty_rowset" [json| {} |] `shouldRespondWith`
[json| [] |]
context "a proc that returns plain text" $
context "a proc that returns plain text" $ do
it "returns proper json" $
post "/rpc/sayhello" [json| { "name": "world" } |] `shouldRespondWith`
[json| [{"sayhello":"Hello, world"}] |]
it "can handle unicode" $
post "/rpc/sayhello" [json| { "name": "" } |] `shouldRespondWith`
[json| [{"sayhello":"Hello, ¥"}] |]
context "improper input" $ do
it "rejects unknown content type even if payload is good" $
request methodPost "/rpc/sayhello"