From b4e59c1dbb2dfdb2579abd2aab2e43b2edab05d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rimas=20Misevi=C4=8Dius?= Date: Wed, 13 May 2020 21:11:05 +0300 Subject: [PATCH 1/2] URL: forbid <, >, and ^ in hosts See https://github.com/whatwg/url/pull/459 for context --- url/resources/urltestdata.json | 55 +++++++++++++++++++++++++++++++--- 1 file changed, 51 insertions(+), 4 deletions(-) diff --git a/url/resources/urltestdata.json b/url/resources/urltestdata.json index dd40eaa5a9f179..28bc1a1acf7ec7 100644 --- a/url/resources/urltestdata.json +++ b/url/resources/urltestdata.json @@ -4482,15 +4482,15 @@ "hash": "" }, { - "input": "sc://\u001F!\"$&'()*+,-.;<=>^_`{|}~/", + "input": "sc://\u001F!\"$&'()*+,-.;=_`{|}~/", "base": "about:blank", - "href": "sc://%1F!\"$&'()*+,-.;<=>^_`{|}~/", + "href": "sc://%1F!\"$&'()*+,-.;=_`{|}~/", "origin": "null", "protocol": "sc:", "username": "", "password": "", - "host": "%1F!\"$&'()*+,-.;<=>^_`{|}~", - "hostname": "%1F!\"$&'()*+,-.;<=>^_`{|}~", + "host": "%1F!\"$&'()*+,-.;=_`{|}~", + "hostname": "%1F!\"$&'()*+,-.;=_`{|}~", "port": "", "pathname": "/", "search": "", @@ -4649,6 +4649,53 @@ "search": "", "hash": "" }, + "Forbidden host code points", + { + "input": "http://ab", + "base": "about:blank", + "failure": true + }, + { + "input": "http://a^b", + "base": "about:blank", + "failure": true + }, + { + "input": "non-special://ab", + "base": "about:blank", + "failure": true + }, + { + "input": "non-special://a^b", + "base": "about:blank", + "failure": true + }, + "Allowed host code points", + { + "input": "http://\u001F!\"$&'()*+,-.;=_`{|}~/", + "base": "about:blank", + "href": "http://\u001F!\"$&'()*+,-.;=_`{|}~/", + "origin": "http://\u001F!\"$&'()*+,-.;=_`{|}~", + "protocol": "http:", + "username": "", + "password": "", + "host": "\u001F!\"$&'()*+,-.;=_`{|}~", + "hostname": "\u001F!\"$&'()*+,-.;=_`{|}~", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, "# Hosts and percent-encoding", { "input": "ftp://example.com%80/", From d78d8498ee5da2d6afee42f83bf57fd453831e85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rimas=20Misevi=C4=8Dius?= Date: Thu, 14 May 2020 19:16:38 +0300 Subject: [PATCH 2/2] Feedback: move test --- url/resources/urltestdata.json | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/url/resources/urltestdata.json b/url/resources/urltestdata.json index 28bc1a1acf7ec7..1ed95583c12f3d 100644 --- a/url/resources/urltestdata.json +++ b/url/resources/urltestdata.json @@ -4481,21 +4481,6 @@ "search": "", "hash": "" }, - { - "input": "sc://\u001F!\"$&'()*+,-.;=_`{|}~/", - "base": "about:blank", - "href": "sc://%1F!\"$&'()*+,-.;=_`{|}~/", - "origin": "null", - "protocol": "sc:", - "username": "", - "password": "", - "host": "%1F!\"$&'()*+,-.;=_`{|}~", - "hostname": "%1F!\"$&'()*+,-.;=_`{|}~", - "port": "", - "pathname": "/", - "search": "", - "hash": "" - }, { "input": "sc://\u0000/", "base": "about:blank", @@ -4696,6 +4681,21 @@ "search": "", "hash": "" }, + { + "input": "sc://\u001F!\"$&'()*+,-.;=_`{|}~/", + "base": "about:blank", + "href": "sc://%1F!\"$&'()*+,-.;=_`{|}~/", + "origin": "null", + "protocol": "sc:", + "username": "", + "password": "", + "host": "%1F!\"$&'()*+,-.;=_`{|}~", + "hostname": "%1F!\"$&'()*+,-.;=_`{|}~", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, "# Hosts and percent-encoding", { "input": "ftp://example.com%80/",