{"action":"created","comment":{"url":"https://api.github.com/repos/playframework/playframework/pulls/comments/39941136","id":39941136,"diff_hunk":"@@ -70,19 +72,11 @@ object FormUrlEncodedParser {\n    * @return The sequence of key/value pairs\n    */\n   private def parseToPairs(data: String, encoding: String): Seq[(String, String)] = {\n-\n-    import java.net._\n-\n-    // Generate all the pairs, with potentially redundant key values, by parsing the body content.\n-    data.split('&').flatMap { param =>\n-      if (param.contains(\"=\") && !param.startsWith(\"=\")) {\n-        val parts = param.split(\"=\")\n-        val key = URLDecoder.decode(parts.head, encoding)\n-        val value = URLDecoder.decode(parts.tail.headOption.getOrElse(\"\"), encoding)\n-        Seq(key -> value)\n-      } else {\n-        Nil\n-      }\n-    }.toSeq\n+    data.split(\"&|;\").map { param =>","path":"framework/src/play/src/main/scala/play/core/parsers/FormUrlEncodedParser.scala","position":27,"original_position":27,"commit_id":"21cae135d0e7fd9b75166a6660289f4a0cb45031","original_commit_id":"21cae135d0e7fd9b75166a6660289f4a0cb45031","user":{"login":"jroper","id":105833,"avatar_url":"https://avatars.githubusercontent.com/u/105833?v=3","gravatar_id":"","url":"https://api.github.com/users/jroper","html_url":"https://github.com/jroper","followers_url":"https://api.github.com/users/jroper/followers","following_url":"https://api.github.com/users/jroper/following{/other_user}","gists_url":"https://api.github.com/users/jroper/gists{/gist_id}","starred_url":"https://api.github.com/users/jroper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jroper/subscriptions","organizations_url":"https://api.github.com/users/jroper/orgs","repos_url":"https://api.github.com/users/jroper/repos","events_url":"https://api.github.com/users/jroper/events{/privacy}","received_events_url":"https://api.github.com/users/jroper/received_events","type":"User","site_admin":false},"body":"Unlike splitting on a single character, splitting on a regular expression will parse/compile the regular expression on every invocation. It would be more performant to hold the regular expression in a `val` on an `object` and use it to split.","created_at":"2015-09-21T04:25:02Z","updated_at":"2015-09-21T04:25:02Z","html_url":"https://github.com/playframework/playframework/pull/5110#discussion_r39941136","pull_request_url":"https://api.github.com/repos/playframework/playframework/pulls/5110","_links":{"self":{"href":"https://api.github.com/repos/playframework/playframework/pulls/comments/39941136"},"html":{"href":"https://github.com/playframework/playframework/pull/5110#discussion_r39941136"},"pull_request":{"href":"https://api.github.com/repos/playframework/playframework/pulls/5110"}}},"pull_request":{"url":"https://api.github.com/repos/playframework/playframework/pulls/5110","id":45485840,"html_url":"https://github.com/playframework/playframework/pull/5110","diff_url":"https://github.com/playframework/playframework/pull/5110.diff","patch_url":"https://github.com/playframework/playframework/pull/5110.patch","issue_url":"https://api.github.com/repos/playframework/playframework/issues/5110","number":5110,"state":"open","locked":false,"title":"More standard application/x-www-form-urlencoded parsing","user":{"login":"pauldraper","id":1403271,"avatar_url":"https://avatars.githubusercontent.com/u/1403271?v=3","gravatar_id":"","url":"https://api.github.com/users/pauldraper","html_url":"https://github.com/pauldraper","followers_url":"https://api.github.com/users/pauldraper/followers","following_url":"https://api.github.com/users/pauldraper/following{/other_user}","gists_url":"https://api.github.com/users/pauldraper/gists{/gist_id}","starred_url":"https://api.github.com/users/pauldraper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pauldraper/subscriptions","organizations_url":"https://api.github.com/users/pauldraper/orgs","repos_url":"https://api.github.com/users/pauldraper/repos","events_url":"https://api.github.com/users/pauldraper/events{/privacy}","received_events_url":"https://api.github.com/users/pauldraper/received_events","type":"User","site_admin":false},"body":"* Allow semicolon separators in addition to ampersands\r\n* Parse empty/non-existant names and values\r\n\r\n---\r\n\r\nW3C [recommends](http://www.w3.org/TR/1999/REC-html401-19991224/appendix/notes.html#h-B.2.2) accepting semicolons separators.\r\n\r\n> We recommend that HTTP server implementors, and in particular, CGI implementors support the use of \";\" in place of \"&\"\r\n\r\nOld stuff, but most parsers still follow the recommendation.\r\n\r\nAlso, most parsers accept empty names and values, and non-existent values. For example, the example request in [RFC 5849 3.4.1.3.1](http://tools.ietf.org/html/rfc5849#section-3.4.1.3.1) (OAuth 1.0) has the body\r\n\r\n```\r\nc2&a3=2+q\r\n```\r\n\r\nand requires parsing the `c2` parameter in order for OAuth to work.\r\n\r\n---\r\n\r\nMost parsers allow these two usages, for example `com.apache.http.client.utils.URLEncodedUtils` or `io.netty.handler.codec.http.QueryStringDecoder` (HTML forms put fields in GET query strings, hence the name).\r\n\r\nI would have used one of those rather than implementing it myself, but the `play` project doesn't currently depend on either.","created_at":"2015-09-19T22:48:39Z","updated_at":"2015-09-21T04:25:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"00c176d8dab02c2b5ba7002a61aa074b83dee0cf","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/playframework/playframework/pulls/5110/commits","review_comments_url":"https://api.github.com/repos/playframework/playframework/pulls/5110/comments","review_comment_url":"https://api.github.com/repos/playframework/playframework/pulls/comments{/number}","comments_url":"https://api.github.com/repos/playframework/playframework/issues/5110/comments","statuses_url":"https://api.github.com/repos/playframework/playframework/statuses/21cae135d0e7fd9b75166a6660289f4a0cb45031","head":{"label":"pauldraper:paul-form-url-parser","ref":"paul-form-url-parser","sha":"21cae135d0e7fd9b75166a6660289f4a0cb45031","user":{"login":"pauldraper","id":1403271,"avatar_url":"https://avatars.githubusercontent.com/u/1403271?v=3","gravatar_id":"","url":"https://api.github.com/users/pauldraper","html_url":"https://github.com/pauldraper","followers_url":"https://api.github.com/users/pauldraper/followers","following_url":"https://api.github.com/users/pauldraper/following{/other_user}","gists_url":"https://api.github.com/users/pauldraper/gists{/gist_id}","starred_url":"https://api.github.com/users/pauldraper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pauldraper/subscriptions","organizations_url":"https://api.github.com/users/pauldraper/orgs","repos_url":"https://api.github.com/users/pauldraper/repos","events_url":"https://api.github.com/users/pauldraper/events{/privacy}","received_events_url":"https://api.github.com/users/pauldraper/received_events","type":"User","site_admin":false},"repo":{"id":22305257,"name":"playframework","full_name":"pauldraper/playframework","owner":{"login":"pauldraper","id":1403271,"avatar_url":"https://avatars.githubusercontent.com/u/1403271?v=3","gravatar_id":"","url":"https://api.github.com/users/pauldraper","html_url":"https://github.com/pauldraper","followers_url":"https://api.github.com/users/pauldraper/followers","following_url":"https://api.github.com/users/pauldraper/following{/other_user}","gists_url":"https://api.github.com/users/pauldraper/gists{/gist_id}","starred_url":"https://api.github.com/users/pauldraper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pauldraper/subscriptions","organizations_url":"https://api.github.com/users/pauldraper/orgs","repos_url":"https://api.github.com/users/pauldraper/repos","events_url":"https://api.github.com/users/pauldraper/events{/privacy}","received_events_url":"https://api.github.com/users/pauldraper/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pauldraper/playframework","description":"Play Framework","fork":true,"url":"https://api.github.com/repos/pauldraper/playframework","forks_url":"https://api.github.com/repos/pauldraper/playframework/forks","keys_url":"https://api.github.com/repos/pauldraper/playframework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pauldraper/playframework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pauldraper/playframework/teams","hooks_url":"https://api.github.com/repos/pauldraper/playframework/hooks","issue_events_url":"https://api.github.com/repos/pauldraper/playframework/issues/events{/number}","events_url":"https://api.github.com/repos/pauldraper/playframework/events","assignees_url":"https://api.github.com/repos/pauldraper/playframework/assignees{/user}","branches_url":"https://api.github.com/repos/pauldraper/playframework/branches{/branch}","tags_url":"https://api.github.com/repos/pauldraper/playframework/tags","blobs_url":"https://api.github.com/repos/pauldraper/playframework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pauldraper/playframework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pauldraper/playframework/git/refs{/sha}","trees_url":"https://api.github.com/repos/pauldraper/playframework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pauldraper/playframework/statuses/{sha}","languages_url":"https://api.github.com/repos/pauldraper/playframework/languages","stargazers_url":"https://api.github.com/repos/pauldraper/playframework/stargazers","contributors_url":"https://api.github.com/repos/pauldraper/playframework/contributors","subscribers_url":"https://api.github.com/repos/pauldraper/playframework/subscribers","subscription_url":"https://api.github.com/repos/pauldraper/playframework/subscription","commits_url":"https://api.github.com/repos/pauldraper/playframework/commits{/sha}","git_commits_url":"https://api.github.com/repos/pauldraper/playframework/git/commits{/sha}","comments_url":"https://api.github.com/repos/pauldraper/playframework/comments{/number}","issue_comment_url":"https://api.github.com/repos/pauldraper/playframework/issues/comments{/number}","contents_url":"https://api.github.com/repos/pauldraper/playframework/contents/{+path}","compare_url":"https://api.github.com/repos/pauldraper/playframework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pauldraper/playframework/merges","archive_url":"https://api.github.com/repos/pauldraper/playframework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pauldraper/playframework/downloads","issues_url":"https://api.github.com/repos/pauldraper/playframework/issues{/number}","pulls_url":"https://api.github.com/repos/pauldraper/playframework/pulls{/number}","milestones_url":"https://api.github.com/repos/pauldraper/playframework/milestones{/number}","notifications_url":"https://api.github.com/repos/pauldraper/playframework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pauldraper/playframework/labels{/name}","releases_url":"https://api.github.com/repos/pauldraper/playframework/releases{/id}","created_at":"2014-07-27T06:50:41Z","updated_at":"2015-01-03T16:48:49Z","pushed_at":"2015-09-19T22:41:04Z","git_url":"git://github.com/pauldraper/playframework.git","ssh_url":"git@github.com:pauldraper/playframework.git","clone_url":"https://github.com/pauldraper/playframework.git","svn_url":"https://github.com/pauldraper/playframework","homepage":"http://www.playframework.com/","size":74057,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"playframework:master","ref":"master","sha":"c7e37d740630c46f57e83629fd0e0606b479eabb","user":{"login":"playframework","id":319107,"avatar_url":"https://avatars.githubusercontent.com/u/319107?v=3","gravatar_id":"","url":"https://api.github.com/users/playframework","html_url":"https://github.com/playframework","followers_url":"https://api.github.com/users/playframework/followers","following_url":"https://api.github.com/users/playframework/following{/other_user}","gists_url":"https://api.github.com/users/playframework/gists{/gist_id}","starred_url":"https://api.github.com/users/playframework/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/playframework/subscriptions","organizations_url":"https://api.github.com/users/playframework/orgs","repos_url":"https://api.github.com/users/playframework/repos","events_url":"https://api.github.com/users/playframework/events{/privacy}","received_events_url":"https://api.github.com/users/playframework/received_events","type":"Organization","site_admin":false},"repo":{"id":2340549,"name":"playframework","full_name":"playframework/playframework","owner":{"login":"playframework","id":319107,"avatar_url":"https://avatars.githubusercontent.com/u/319107?v=3","gravatar_id":"","url":"https://api.github.com/users/playframework","html_url":"https://github.com/playframework","followers_url":"https://api.github.com/users/playframework/followers","following_url":"https://api.github.com/users/playframework/following{/other_user}","gists_url":"https://api.github.com/users/playframework/gists{/gist_id}","starred_url":"https://api.github.com/users/playframework/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/playframework/subscriptions","organizations_url":"https://api.github.com/users/playframework/orgs","repos_url":"https://api.github.com/users/playframework/repos","events_url":"https://api.github.com/users/playframework/events{/privacy}","received_events_url":"https://api.github.com/users/playframework/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/playframework/playframework","description":"Play Framework","fork":false,"url":"https://api.github.com/repos/playframework/playframework","forks_url":"https://api.github.com/repos/playframework/playframework/forks","keys_url":"https://api.github.com/repos/playframework/playframework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/playframework/playframework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/playframework/playframework/teams","hooks_url":"https://api.github.com/repos/playframework/playframework/hooks","issue_events_url":"https://api.github.com/repos/playframework/playframework/issues/events{/number}","events_url":"https://api.github.com/repos/playframework/playframework/events","assignees_url":"https://api.github.com/repos/playframework/playframework/assignees{/user}","branches_url":"https://api.github.com/repos/playframework/playframework/branches{/branch}","tags_url":"https://api.github.com/repos/playframework/playframework/tags","blobs_url":"https://api.github.com/repos/playframework/playframework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/playframework/playframework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/playframework/playframework/git/refs{/sha}","trees_url":"https://api.github.com/repos/playframework/playframework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/playframework/playframework/statuses/{sha}","languages_url":"https://api.github.com/repos/playframework/playframework/languages","stargazers_url":"https://api.github.com/repos/playframework/playframework/stargazers","contributors_url":"https://api.github.com/repos/playframework/playframework/contributors","subscribers_url":"https://api.github.com/repos/playframework/playframework/subscribers","subscription_url":"https://api.github.com/repos/playframework/playframework/subscription","commits_url":"https://api.github.com/repos/playframework/playframework/commits{/sha}","git_commits_url":"https://api.github.com/repos/playframework/playframework/git/commits{/sha}","comments_url":"https://api.github.com/repos/playframework/playframework/comments{/number}","issue_comment_url":"https://api.github.com/repos/playframework/playframework/issues/comments{/number}","contents_url":"https://api.github.com/repos/playframework/playframework/contents/{+path}","compare_url":"https://api.github.com/repos/playframework/playframework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/playframework/playframework/merges","archive_url":"https://api.github.com/repos/playframework/playframework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/playframework/playframework/downloads","issues_url":"https://api.github.com/repos/playframework/playframework/issues{/number}","pulls_url":"https://api.github.com/repos/playframework/playframework/pulls{/number}","milestones_url":"https://api.github.com/repos/playframework/playframework/milestones{/number}","notifications_url":"https://api.github.com/repos/playframework/playframework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/playframework/playframework/labels{/name}","releases_url":"https://api.github.com/repos/playframework/playframework/releases{/id}","created_at":"2011-09-07T09:24:08Z","updated_at":"2015-09-21T03:53:41Z","pushed_at":"2015-09-20T14:34:03Z","git_url":"git://github.com/playframework/playframework.git","ssh_url":"git@github.com:playframework/playframework.git","clone_url":"https://github.com/playframework/playframework.git","svn_url":"https://github.com/playframework/playframework","homepage":"http://www.playframework.com/","size":128287,"stargazers_count":6811,"watchers_count":6811,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2421,"mirror_url":null,"open_issues_count":290,"forks":2421,"open_issues":290,"watchers":6811,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/playframework/playframework/pulls/5110"},"html":{"href":"https://github.com/playframework/playframework/pull/5110"},"issue":{"href":"https://api.github.com/repos/playframework/playframework/issues/5110"},"comments":{"href":"https://api.github.com/repos/playframework/playframework/issues/5110/comments"},"review_comments":{"href":"https://api.github.com/repos/playframework/playframework/pulls/5110/comments"},"review_comment":{"href":"https://api.github.com/repos/playframework/playframework/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/playframework/playframework/pulls/5110/commits"},"statuses":{"href":"https://api.github.com/repos/playframework/playframework/statuses/21cae135d0e7fd9b75166a6660289f4a0cb45031"}}}}