{"action":"created","issue":{"url":"https://api.github.com/repos/playframework/play-ws/issues/288","repository_url":"https://api.github.com/repos/playframework/play-ws","labels_url":"https://api.github.com/repos/playframework/play-ws/issues/288/labels{/name}","comments_url":"https://api.github.com/repos/playframework/play-ws/issues/288/comments","events_url":"https://api.github.com/repos/playframework/play-ws/issues/288/events","html_url":"https://github.com/playframework/play-ws/pull/288","id":374847353,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI2NDI5ODQ3","number":288,"title":"WSRequest: Normalize URL","user":{"login":"htmldoug","id":663139,"node_id":"MDQ6VXNlcjY2MzEzOQ==","avatar_url":"https://avatars2.githubusercontent.com/u/663139?v=4","gravatar_id":"","url":"https://api.github.com/users/htmldoug","html_url":"https://github.com/htmldoug","followers_url":"https://api.github.com/users/htmldoug/followers","following_url":"https://api.github.com/users/htmldoug/following{/other_user}","gists_url":"https://api.github.com/users/htmldoug/gists{/gist_id}","starred_url":"https://api.github.com/users/htmldoug/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/htmldoug/subscriptions","organizations_url":"https://api.github.com/users/htmldoug/orgs","repos_url":"https://api.github.com/users/htmldoug/repos","events_url":"https://api.github.com/users/htmldoug/events{/privacy}","received_events_url":"https://api.github.com/users/htmldoug/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-10-29T03:43:32Z","updated_at":"2018-12-09T00:37:54Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/playframework/play-ws/pulls/288","html_url":"https://github.com/playframework/play-ws/pull/288","diff_url":"https://github.com/playframework/play-ws/pull/288.diff","patch_url":"https://github.com/playframework/play-ws/pull/288.patch"},"body":"# Pull Request Checklist\r\n\r\n* [x] Have you read through the [contributor guidelines](https://www.playframework.com/contributing)?\r\n* [x] Have you signed the [Typesafe CLA](https://www.typesafe.com/contribute/cla)?\r\n* [x] Have you [squashed your commits](https://www.playframework.com/documentation/latest/WorkingWithGit#Squashing-commits)?\r\n* [x] Have you added copyright headers to new files?\r\n* [x] Have you checked that both Scala and Java APIs are updated?\r\n* [x] Have you updated the documentation for both Scala and Java sections?\r\n* [x] Have you added tests for any changed functionality?\r\n\r\n## Fixes\r\n\r\nFixes #267\r\n\r\n## Purpose\r\n\r\nEnsure that `StandaloneWSRequest.uri` does not return invalid values or throw, by normalizing the `url: String` when a `StandaloneWSRequest` is constructed. Same approach is used by the java implementation.\r\n\r\n## Background Context\r\n\r\nThis approach follows the \"tolerant\" recommendation, https://github.com/playframework/play-ws/issues/267#issuecomment-419266583.\r\n\r\nEnsures:\r\n1. `StandaloneWSRequest.url` path is encoded.\r\n2. Any query params present in the URL are moved to `StandaloneWSRequest.queryString`.\r\n\r\nImplementation is based upon a `WSRequestFilter`-like decorator I've been using in production since June 2018. An advantage to fixing the request right away is that `request.uri` can be invoked safely sooner in the process.\r\n\r\n### Caveats\r\nNormalization can still be bypassed by:\r\n* `StandaloneAhcWSClient.copy(url = \">^..^<\", ...)`\r\n* `new StandaloneAhcWSRequest(client, \">^..^<\", ...)`"},"comment":{"url":"https://api.github.com/repos/playframework/play-ws/issues/comments/445500810","html_url":"https://github.com/playframework/play-ws/pull/288#issuecomment-445500810","issue_url":"https://api.github.com/repos/playframework/play-ws/issues/288","id":445500810,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0NTUwMDgxMA==","user":{"login":"htmldoug","id":663139,"node_id":"MDQ6VXNlcjY2MzEzOQ==","avatar_url":"https://avatars2.githubusercontent.com/u/663139?v=4","gravatar_id":"","url":"https://api.github.com/users/htmldoug","html_url":"https://github.com/htmldoug","followers_url":"https://api.github.com/users/htmldoug/followers","following_url":"https://api.github.com/users/htmldoug/following{/other_user}","gists_url":"https://api.github.com/users/htmldoug/gists{/gist_id}","starred_url":"https://api.github.com/users/htmldoug/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/htmldoug/subscriptions","organizations_url":"https://api.github.com/users/htmldoug/orgs","repos_url":"https://api.github.com/users/htmldoug/repos","events_url":"https://api.github.com/users/htmldoug/events{/privacy}","received_events_url":"https://api.github.com/users/htmldoug/received_events","type":"User","site_admin":false},"created_at":"2018-12-09T00:37:54Z","updated_at":"2018-12-09T00:37:54Z","author_association":"CONTRIBUTOR","body":"@marcospereira @gmethvin @wsargent can I get a review please?"}}
{"actor":{"display_login":"htmldoug"}}