URL-encode POST parameters in yesod-test#1617
Conversation
|
Wait – sorry, I got something wrong in the way it works for multipart/form-data. (I only ran into the bug with x-www-form-urlencoded.) Will push something new when I'm more confident! |
|
Okay,* I think this is right (08a9632). multipart/form-data didn't need the fix, only x-www-form-urlencoded. (I fooled myself into thinking it did because of a confounding difference in one test returning text/plain and the other text/html.) Please squash when merging! |
snoyberg
left a comment
There was a problem hiding this comment.
Please add a ChangeLog comment. Also, it doesn't look like the modified test case is testing both url-encoded and form data request types, am I correct?
I believe it does test both types. The |
| setUrl ("/form" :: Text) | ||
| byLabel "Some Label" "12345" | ||
| byLabel "Some Label" "foo+bar%41<&baz" | ||
| fileByLabel "Some File" "test/main.hs" "text/plain" |
There was a problem hiding this comment.
Here's the test case that passes through special characters with multipart/form-data. (This test did not fail previously, so the bug I'm fixing here is only with form-url-encoded. I thought it failed at one point, because the endpoint this test is accessing returns HTML instead fo text, so & comes through as & etc.
There was a problem hiding this comment.
Got it, thanks for clarifying.
Addresses #1616. Includes tests that fail without the corresponding change to the code. Potentially this change could cause somebody's tests to fail, if they were already working around the issue (because URL-encoding is not idempotent).
Before submitting your PR, check that you've:
After submitting your PR: