Skip to content

Commit

Permalink
Don't decode arbitrary %2e during URL parsing after all
Browse files Browse the repository at this point in the history
This reverts commit 47d2089 and also updates setter tests that were added later.

See whatwg/url#87 for discussion and whatwg/url#156 for the URL Standard PR.
  • Loading branch information
annevk authored Jan 3, 2017
1 parent e001240 commit d93247d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions url/setters_tests.json
Original file line number Diff line number Diff line change
Expand Up @@ -952,8 +952,8 @@
"href": "view-source+http://example.net/home?lang=fr#nav",
"new_value": "\\a\\%2E\\b\\%2e.\\c",
"expected": {
"href": "view-source+http://example.net/\\a\\.\\b\\..\\c?lang=fr#nav",
"pathname": "/\\a\\.\\b\\..\\c"
"href": "view-source+http://example.net/\\a\\%2E\\b\\%2e.\\c?lang=fr#nav",
"pathname": "/\\a\\%2E\\b\\%2e.\\c"
}
},
{
Expand All @@ -966,12 +966,12 @@
}
},
{
"comment": "Bytes already percent-encoded are left as-is, except %2E.",
"comment": "Bytes already percent-encoded are left as-is, including %2E outside dotted segments.",
"href": "http://example.net",
"new_value": "%2e%2E%c3%89té",
"expected": {
"href": "http://example.net/..%c3%89t%C3%A9",
"pathname": "/..%c3%89t%C3%A9"
"href": "http://example.net/%2e%2E%c3%89t%C3%A9",
"pathname": "/%2e%2E%c3%89t%C3%A9"
}
},
{
Expand Down
12 changes: 6 additions & 6 deletions url/urltestdata.json
Original file line number Diff line number Diff line change
Expand Up @@ -1845,30 +1845,30 @@
{
"input": "http://example.com/foo/%2e%2",
"base": "about:blank",
"href": "http://example.com/foo/.%2",
"href": "http://example.com/foo/%2e%2",
"origin": "http://example.com",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/foo/.%2",
"pathname": "/foo/%2e%2",
"search": "",
"hash": ""
},
{
"input": "http://example.com/foo/%2e./%2e%2e/.%2e/%2e.bar",
"base": "about:blank",
"href": "http://example.com/..bar",
"href": "http://example.com/%2e.bar",
"origin": "http://example.com",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/..bar",
"pathname": "/%2e.bar",
"search": "",
"hash": ""
},
Expand Down Expand Up @@ -2286,15 +2286,15 @@
{
"input": "http://www/foo%2Ehtml",
"base": "about:blank",
"href": "http://www/foo.html",
"href": "http://www/foo%2Ehtml",
"origin": "http://www",
"protocol": "http:",
"username": "",
"password": "",
"host": "www",
"hostname": "www",
"port": "",
"pathname": "/foo.html",
"pathname": "/foo%2Ehtml",
"search": "",
"hash": ""
},
Expand Down

0 comments on commit d93247d

Please sign in to comment.