From d93247d5cb7d70f80da8b154a171f4e3d50969f4 Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Tue, 3 Jan 2017 18:48:50 +0100 Subject: [PATCH] Don't decode arbitrary %2e during URL parsing after all This reverts commit 47d2089cb11d5f5047f3bd2f183eecd471bc2d07 and also updates setter tests that were added later. See https://github.com/whatwg/url/issues/87 for discussion and https://github.com/whatwg/url/pull/156 for the URL Standard PR. --- url/setters_tests.json | 10 +++++----- url/urltestdata.json | 12 ++++++------ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/url/setters_tests.json b/url/setters_tests.json index d24f5157f16f21..62ed3a5c372b99 100644 --- a/url/setters_tests.json +++ b/url/setters_tests.json @@ -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" } }, { @@ -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" } }, { diff --git a/url/urltestdata.json b/url/urltestdata.json index 135330a2167012..cd96644b8e9d39 100644 --- a/url/urltestdata.json +++ b/url/urltestdata.json @@ -1845,7 +1845,7 @@ { "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": "", @@ -1853,14 +1853,14 @@ "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": "", @@ -1868,7 +1868,7 @@ "host": "example.com", "hostname": "example.com", "port": "", - "pathname": "/..bar", + "pathname": "/%2e.bar", "search": "", "hash": "" }, @@ -2286,7 +2286,7 @@ { "input": "http://www/foo%2Ehtml", "base": "about:blank", - "href": "http://www/foo.html", + "href": "http://www/foo%2Ehtml", "origin": "http://www", "protocol": "http:", "username": "", @@ -2294,7 +2294,7 @@ "host": "www", "hostname": "www", "port": "", - "pathname": "/foo.html", + "pathname": "/foo%2Ehtml", "search": "", "hash": "" },