{"action":"created","issue":{"url":"https://api.github.com/repos/owickstrom/hyper/issues/62","repository_url":"https://api.github.com/repos/owickstrom/hyper","labels_url":"https://api.github.com/repos/owickstrom/hyper/issues/62/labels{/name}","comments_url":"https://api.github.com/repos/owickstrom/hyper/issues/62/comments","events_url":"https://api.github.com/repos/owickstrom/hyper/issues/62/events","html_url":"https://github.com/owickstrom/hyper/pull/62","id":328475580,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkyMDAyODcw","number":62,"title":"Parse urlencoded+replace plus","user":{"login":"paluh","id":190249,"node_id":"MDQ6VXNlcjE5MDI0OQ==","avatar_url":"https://avatars0.githubusercontent.com/u/190249?v=4","gravatar_id":"","url":"https://api.github.com/users/paluh","html_url":"https://github.com/paluh","followers_url":"https://api.github.com/users/paluh/followers","following_url":"https://api.github.com/users/paluh/following{/other_user}","gists_url":"https://api.github.com/users/paluh/gists{/gist_id}","starred_url":"https://api.github.com/users/paluh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paluh/subscriptions","organizations_url":"https://api.github.com/users/paluh/orgs","repos_url":"https://api.github.com/users/paluh/repos","events_url":"https://api.github.com/users/paluh/events{/privacy}","received_events_url":"https://api.github.com/users/paluh/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-06-01T11:04:56Z","updated_at":"2018-06-01T11:19:29Z","closed_at":null,"author_association":"COLLABORATOR","pull_request":{"url":"https://api.github.com/repos/owickstrom/hyper/pulls/62","html_url":"https://github.com/owickstrom/hyper/pull/62","diff_url":"https://github.com/owickstrom/hyper/pull/62.diff","patch_url":"https://github.com/owickstrom/hyper/pull/62.patch"},"body":"This PR provides a way to optionally replace `+` in query values by space before passing them to uri decoding.\r\n\r\nI want to reemphasize importance of this change, so I'm coping my arguments here from `purescript-uri` issue.\r\n\r\nWithout this option hyper user is not able to distinguish `+` from `%2B` in original query as both are decoded to `+` and finally is not able parse text input values containing spaces send by all tested by me modern browsers.\r\n\r\nI've tested on two versions of Firefox and Chromium (latest Firefox nightly 59.0a1 (2017-11-20), Chromium 62.0.3202.89 and Firefox 56.0.2) that this form:\r\n\r\n```\r\n<!DOCTYPE html>\r\n<html>\r\n<body>\r\n  <form action=\".\">\r\n    <input name=\"name with spaces\" value=\"value with spaces\" />\r\n    <input type=\"submit\" value=\"send\" />\r\n  </form>\r\n</body>\r\n</html>\r\n```\r\nresults in + in queries (so we get \"value+with+spaces\"). The same behavior is observed when I add explicit enctype=application/x-www-form-urlencoded.\r\n\r\nI know that this is not a real argument for discussion, but other libs/tools/frameworks do seem to decode `+` as space in query strings:\r\n\r\n   * Haskell http-types (Servant uses http-api-data which uses http-types):\r\n\r\n       parseQuery calls two times `urlDecode` with `True` as the first argument:\r\n\r\n       https://github.com/aristidb/http-types/blob/master/Network/HTTP/Types/URI.hs#L136\r\n\r\n       `urlDecode`:\r\n\r\n       https://github.com/aristidb/http-types/blob/master/Network/HTTP/Types/URI.hs#L206\r\n\r\n\r\n   * Haskell Snap framework decodes `+` in query keys and values to space:\r\n\r\n        https://github.com/snapframework/snap-core/blob/master/src/Snap/Internal/Parsing.hs#L368\r\n\r\n\r\n    * Python3 `urllib.parse` decodes `+` in queries (even in strict mode ;-)):\r\n\r\n        https://github.com/python/cpython/blob/3.6/Lib/urllib/parse.py#L697\r\n\r\n    * Javascript repalces `+` in query keys and values:\r\n\r\n       https://github.com/sindresorhus/query-string/blob/master/index.js#L148"},"comment":{"url":"https://api.github.com/repos/owickstrom/hyper/issues/comments/393851206","html_url":"https://github.com/owickstrom/hyper/pull/62#issuecomment-393851206","issue_url":"https://api.github.com/repos/owickstrom/hyper/issues/62","id":393851206,"node_id":"MDEyOklzc3VlQ29tbWVudDM5Mzg1MTIwNg==","user":{"login":"paluh","id":190249,"node_id":"MDQ6VXNlcjE5MDI0OQ==","avatar_url":"https://avatars0.githubusercontent.com/u/190249?v=4","gravatar_id":"","url":"https://api.github.com/users/paluh","html_url":"https://github.com/paluh","followers_url":"https://api.github.com/users/paluh/followers","following_url":"https://api.github.com/users/paluh/following{/other_user}","gists_url":"https://api.github.com/users/paluh/gists{/gist_id}","starred_url":"https://api.github.com/users/paluh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paluh/subscriptions","organizations_url":"https://api.github.com/users/paluh/orgs","repos_url":"https://api.github.com/users/paluh/repos","events_url":"https://api.github.com/users/paluh/events{/privacy}","received_events_url":"https://api.github.com/users/paluh/received_events","type":"User","site_admin":false},"created_at":"2018-06-01T11:19:29Z","updated_at":"2018-06-01T11:19:29Z","author_association":"COLLABORATOR","body":"Travis detected that examples from docs use `ToForm` and `FromForm` type classes so I should somehow fix them... I'm not sure if I want to bring these classes back (and add additional parameter to `FromForm` method with `Urlencode.Options`). Any comments?"}}
{"actor":{"display_login":"paluh"}}