From 0f7687a471cb626db14a520dcdb57619df9a6bc2 Mon Sep 17 00:00:00 2001 From: Ben Kelly Date: Thu, 23 Sep 2021 10:24:55 +0000 Subject: [PATCH] Bug 1729931 [wpt PR 30471] - URLPattern: Throw on more illegal hostname code points., a=testonly Automatic update from web-platform-tests URLPattern: Throw on more illegal hostname code points. As discussed in the mozilla standards-position issue on URLPattern: https://github.com/mozilla/standards-positions/issues/566 There are a number of URL encoding interop issues between browsers. Since URLPattern delegates to the URL parser for canonicalization it is also exposed to these interop issues. While fixing all of URL's interop issues is orthogonal to shipping URLPattern, we can at least prevent clearly illegal code points from being used in URLPattern. This will avoid increasing usage of these code points which will in turn make it slightly easier to fix the issue in the URL parser in the future. Bug: 1248061 Change-Id: I58a55e4206004a6cba727f19d537c5929ce16d43 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3152036 Reviewed-by: Jeremy Roman Commit-Queue: Ben Kelly Cr-Commit-Position: refs/heads/main@{#920223} -- wpt-commits: 50f3e3a19f6d819268d01143fa4d0146dbdecb59 wpt-pr: 30471 --- .../resources/urlpatterntestdata.json | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/testing/web-platform/tests/urlpattern/resources/urlpatterntestdata.json b/testing/web-platform/tests/urlpattern/resources/urlpatterntestdata.json index 6138b30cdf5e4..867611baddbb5 100644 --- a/testing/web-platform/tests/urlpattern/resources/urlpatterntestdata.json +++ b/testing/web-platform/tests/urlpattern/resources/urlpatterntestdata.json @@ -2359,5 +2359,73 @@ "expected_match": { "protocol": { "input": "foobar", "groups": { "name": "foobar" }} } + }, + { + "pattern": [{ "hostname": "bad hostname" }], + "expected_obj": "error" + }, + { + "pattern": [{ "hostname": "bad#hostname" }], + "expected_obj": "error" + }, + { + "pattern": [{ "hostname": "bad%hostname" }], + "expected_obj": "error" + }, + { + "pattern": [{ "hostname": "bad/hostname" }], + "expected_obj": "error" + }, + { + "pattern": [{ "hostname": "bad\\:hostname" }], + "expected_obj": "error" + }, + { + "pattern": [{ "hostname": "badhostname" }], + "expected_obj": "error" + }, + { + "pattern": [{ "hostname": "bad?hostname" }], + "expected_obj": "error" + }, + { + "pattern": [{ "hostname": "bad@hostname" }], + "expected_obj": "error" + }, + { + "pattern": [{ "hostname": "bad[hostname" }], + "expected_obj": "error" + }, + { + "pattern": [{ "hostname": "bad]hostname" }], + "expected_obj": "error" + }, + { + "pattern": [{ "hostname": "bad\\\\hostname" }], + "expected_obj": "error" + }, + { + "pattern": [{ "hostname": "bad^hostname" }], + "expected_obj": "error" + }, + { + "pattern": [{ "hostname": "bad|hostname" }], + "expected_obj": "error" + }, + { + "pattern": [{ "hostname": "bad\nhostname" }], + "expected_obj": "error" + }, + { + "pattern": [{ "hostname": "bad\rhostname" }], + "expected_obj": "error" + }, + { + "pattern": [{ "hostname": "bad\thostname" }], + "expected_obj": "error" } ]