Skip to content

Commit

Permalink
Bug 1729931 [wpt PR 30471] - URLPattern: Throw on more illegal hostna…
Browse files Browse the repository at this point in the history
…me 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:

mozilla/standards-positions#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 <jbroman@chromium.org>
Commit-Queue: Ben Kelly <wanderview@chromium.org>
Cr-Commit-Position: refs/heads/main@{#920223}

--

wpt-commits: 50f3e3a19f6d819268d01143fa4d0146dbdecb59
wpt-pr: 30471
  • Loading branch information
wanderview authored and moz-wptsync-bot committed Sep 29, 2021
1 parent b24f126 commit 0f7687a
Showing 1 changed file with 68 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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": "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^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"
}
]

0 comments on commit 0f7687a

Please sign in to comment.