Changeset 271899 in webkit


Ignore:
Timestamp:
Jan 26, 2021 1:14:33 PM (18 months ago)
Author:
commit-queue@webkit.org
Message:

Forbid '|' in URL hosts
https://bugs.webkit.org/show_bug.cgi?id=220778

Patch by Alex Christensen <achristensen@webkit.org> on 2021-01-26
Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

  • web-platform-tests/url/a-element-expected.txt:
  • web-platform-tests/url/a-element-origin-expected.txt:
  • web-platform-tests/url/a-element-origin-xhtml-expected.txt:
  • web-platform-tests/url/a-element-xhtml-expected.txt:
  • web-platform-tests/url/failure-expected.txt:
  • web-platform-tests/url/resources/urltestdata.json:
  • web-platform-tests/url/url-constructor-expected.txt:
  • web-platform-tests/url/url-origin-expected.txt:

Source/WTF:

This is one of the proposed solutions to https://github.com/whatwg/url/issues/559
and RFC 3986 and 3987 forbid such characters, so let's try forbidding it.

  • wtf/URLParser.cpp:

(WTF::isC0Control):
(WTF::isForbiddenHostCodePoint):

LayoutTests:

  • fast/url/file-http-base-expected.txt:
  • fast/url/file-http-base.html:
Location:
trunk
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r271893 r271899  
     12021-01-26  Alex Christensen  <achristensen@webkit.org>
     2
     3        Forbid '|' in URL hosts
     4        https://bugs.webkit.org/show_bug.cgi?id=220778
     5
     6        Reviewed by Youenn Fablet.
     7
     8        * fast/url/file-http-base-expected.txt:
     9        * fast/url/file-http-base.html:
     10
    1112021-01-26  Rob Buis  <rbuis@igalia.com>
    212
  • trunk/LayoutTests/fast/url/file-http-base-expected.txt

    r212953 r271899  
    44
    55
    6 FAIL canonicalize('file:c:\\foo\\bar.html') should be file:///C:/foo/bar.html. Was file:///c:/foo/bar.html.
    7 FAIL canonicalize('  File:c|////foo\\bar.html') should be file:///C:////foo/bar.html. Was file:///c:////foo/bar.html.
     6PASS canonicalize('file:c:\\foo\\bar.html') is 'file:///c:/foo/bar.html'
     7PASS canonicalize('  File:c|////foo\\bar.html') is 'file:///c:////foo/bar.html'
    88PASS canonicalize('file:') is 'file:///'
    9 FAIL canonicalize('file:UNChost/path') should be file://unchost/path. Was file:///UNChost/path.
    10 FAIL canonicalize('c:\\foo\\bar') should be file:///C:/foo/bar. Was c:\foo\bar.
    11 FAIL canonicalize('C|/foo/bar') should be file:///C:/foo/bar. Was http://example.com/mock/C|/foo/bar.
    12 FAIL canonicalize('/C|\\foo\\bar') should be file:///C:/foo/bar. Was http://example.com/C|/foo/bar.
    13 FAIL canonicalize('//C|/foo/bar') should be file:///C:/foo/bar. Was http://c|/foo/bar.
    14 FAIL canonicalize('//server/file') should be file://server/file. Was http://server/file.
    15 FAIL canonicalize('\\\\server\\file') should be file://server/file. Was http://server/file.
    16 FAIL canonicalize('/\\server/file') should be file://server/file. Was http://server/file.
    17 FAIL canonicalize('file:c:foo/bar.html') should be file:///C:/foo/bar.html. Was file:///c:foo/bar.html.
    18 FAIL canonicalize('file:/\\/\\C:\\\\//foo\\bar.html') should be file:///C:////foo/bar.html. Was file:////C:////foo/bar.html.
     9PASS canonicalize('file:UNChost/path') is 'file:///UNChost/path'
     10PASS canonicalize('c:\\foo\\bar') is 'c:\\foo\\bar'
     11PASS canonicalize('C|/foo/bar') is 'http://example.com/mock/C|/foo/bar'
     12PASS canonicalize('/C|\\foo\\bar') is 'http://example.com/C|/foo/bar'
     13PASS canonicalize('//C|/foo/bar') is '//C|/foo/bar'
     14PASS canonicalize('//server/file') is 'http://server/file'
     15PASS canonicalize('\\\\server\\file') is 'http://server/file'
     16PASS canonicalize('/\\server/file') is 'http://server/file'
     17PASS canonicalize('file:c:foo/bar.html') is 'file:///c:foo/bar.html'
     18PASS canonicalize('file:/\\/\\C:\\\\//foo\\bar.html') is 'file:////C:////foo/bar.html'
    1919PASS canonicalize('file:///foo/bar.txt') is 'file:///foo/bar.txt'
    20 FAIL canonicalize('FILE:/\\/\\7:\\\\//foo\\bar.html') should be file://7:////foo/bar.html. Was file:////7:////foo/bar.html.
    21 FAIL canonicalize('file:filer/home\\me') should be file://filer/home/me. Was file:///filer/home/me.
     20PASS canonicalize('FILE:/\\/\\7:\\\\//foo\\bar.html') is 'file:////7:////foo/bar.html'
     21PASS canonicalize('file:filer/home\\me') is 'file:///filer/home/me'
    2222PASS canonicalize('file:///C:/foo/../../../bar.html') is 'file:///C:/bar.html'
    23 FAIL canonicalize('file:///C:/asdf#\xc2') should be file:///C:/asdf#Â. Was file:///C:/asdf#%C3%82.
    24 FAIL canonicalize('file:///C:/asdf#Â') should be file:///C:/asdf#Â. Was file:///C:/asdf#%C3%82.
     23PASS canonicalize('file:///C:/asdf#\xc2') is 'file:///C:/asdf#%C3%82'
     24PASS canonicalize('file:///C:/asdf#Â') is 'file:///C:/asdf#%C3%82'
    2525PASS canonicalize('file:///home/me') is 'file:///home/me'
    2626PASS canonicalize('file:c:\\foo\\bar.html') is 'file:///c:/foo/bar.html'
    27 FAIL canonicalize('file:c|//foo\\bar.html') should be file:///c%7C//foo/bar.html. Was file:///c://foo/bar.html.
    28 FAIL canonicalize('//') should be file:///. Was //.
    29 FAIL canonicalize('///') should be file:///. Was ///.
    30 FAIL canonicalize('///test') should be file:///test. Was http://test/.
     27PASS canonicalize('file:c|//foo\\bar.html') is 'file:///c://foo/bar.html'
     28PASS canonicalize('//') is '//'
     29PASS canonicalize('///') is '///'
     30PASS canonicalize('///test') is 'http://test/'
    3131PASS canonicalize('file://test') is 'file://test/'
    32 FAIL canonicalize('file://localhost') should be file://localhost/. Was file:///.
    33 FAIL canonicalize('file://localhost/') should be file://localhost/. Was file:///.
    34 FAIL canonicalize('file://localhost/test') should be file://localhost/test. Was file:///test.
     32PASS canonicalize('file://localhost') is 'file:///'
     33PASS canonicalize('file://localhost/') is 'file:///'
     34PASS canonicalize('file://localhost/test') is 'file:///test'
    3535PASS successfullyParsed is true
    3636
  • trunk/LayoutTests/fast/url/file-http-base.html

    r174160 r271899  
    1212cases = [
    1313    // Windows-style paths
    14     ["file:c:\\\\foo\\\\bar.html", "file:///C:/foo/bar.html"],
    15     ["  File:c|////foo\\\\bar.html", "file:///C:////foo/bar.html"],
     14    ["file:c:\\\\foo\\\\bar.html", "file:///c:/foo/bar.html"],
     15    ["  File:c|////foo\\\\bar.html", "file:///c:////foo/bar.html"],
    1616    ["file:", "file:///"],
    17     ["file:UNChost/path", "file://unchost/path"],
     17    ["file:UNChost/path", "file:///UNChost/path"],
    1818    // CanonicalizeFileURL supports absolute Windows style paths for IE
    1919    // compatability. Note that the caller must decide that this is a file
    2020    // URL itself so it can call the file canonicalizer. This is usually
    2121    // done automatically as part of relative URL resolving.
    22     ["c:\\\\foo\\\\bar", "file:///C:/foo/bar"],
    23     ["C|/foo/bar", "file:///C:/foo/bar"],
    24     ["/C|\\\\foo\\\\bar", "file:///C:/foo/bar"],
    25     ["//C|/foo/bar", "file:///C:/foo/bar"],
    26     ["//server/file", "file://server/file"],
    27     ["\\\\\\\\server\\\\file", "file://server/file"],
    28     ["/\\\\server/file", "file://server/file"],
     22    ["c:\\\\foo\\\\bar", "c:\\\\foo\\\\bar"],
     23    ["C|/foo/bar", "http://example.com/mock/C|/foo/bar"],
     24    ["/C|\\\\foo\\\\bar", "http://example.com/C|/foo/bar"],
     25    ["//C|/foo/bar", "//C|/foo/bar"],
     26    ["//server/file", "http://server/file"],
     27    ["\\\\\\\\server\\\\file", "http://server/file"],
     28    ["/\\\\server/file", "http://server/file"],
    2929    // We should preserve the number of slashes after the colon for IE
    3030    // compatability, except when there is none, in which case we should
    3131    // add one.
    32     ["file:c:foo/bar.html", "file:///C:/foo/bar.html"],
    33     ["file:/\\\\/\\\\C:\\\\\\\\//foo\\\\bar.html", "file:///C:////foo/bar.html"],
     32    ["file:c:foo/bar.html", "file:///c:foo/bar.html"],
     33    ["file:/\\\\/\\\\C:\\\\\\\\//foo\\\\bar.html", "file:////C:////foo/bar.html"],
    3434    // Three slashes should be non-UNC, even if there is no drive spec (IE
    3535    // does this, which makes the resulting request invalid).
     
    4141    // seem to be a strong argument for why allowing it here would be bad, so
    4242    // we just tolerate it and the load will fail later.
    43     ["FILE:/\\\\/\\\\7:\\\\\\\\//foo\\\\bar.html", "file://7:////foo/bar.html"],
    44     ["file:filer/home\\\\me", "file://filer/home/me"],
     43    ["FILE:/\\\\/\\\\7:\\\\\\\\//foo\\\\bar.html", "file:////7:////foo/bar.html"],
     44    ["file:filer/home\\\\me", "file:///filer/home/me"],
    4545    // Make sure relative paths can't go above the "C:"
    4646    ["file:///C:/foo/../../../bar.html", "file:///C:/bar.html"],
    4747    // Busted refs shouldn't make the whole thing fail.
    48     ["file:///C:/asdf#\\xc2", "file:///C:/asdf#\\xc2"],
    49     ["file:///C:/asdf#\xc2", "file:///C:/asdf#\xc2"],
     48    ["file:///C:/asdf#\\xc2", "file:///C:/asdf#%C3%82"],
     49    ["file:///C:/asdf#\xc2", "file:///C:/asdf#%C3%82"],
    5050
    5151    // Unix-style paths
     
    5353    // Windowsy ones should get still treated as Unix-style.
    5454    ["file:c:\\\\foo\\\\bar.html", "file:///c:/foo/bar.html"],
    55     ["file:c|//foo\\\\bar.html", "file:///c%7C//foo/bar.html"],
     55    ["file:c|//foo\\\\bar.html", "file:///c://foo/bar.html"],
    5656    // file: tests from WebKit (LayoutTests/fast/loader/url-parse-1.html)
    57     ["//", "file:///"],
    58     ["///", "file:///"],
    59     ["///test", "file:///test"],
     57    ["//", "//"],
     58    ["///", "///"],
     59    ["///test", "http://test/"],
    6060    ["file://test", "file://test/"],
    61     ["file://localhost",  "file://localhost/"],
    62     ["file://localhost/", "file://localhost/"],
    63     ["file://localhost/test", "file://localhost/test"],
     61    ["file://localhost",  "file:///"],
     62    ["file://localhost/", "file:///"],
     63    ["file://localhost/test", "file:///test"],
    6464];
    6565
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r271893 r271899  
     12021-01-26  Alex Christensen  <achristensen@webkit.org>
     2
     3        Forbid '|' in URL hosts
     4        https://bugs.webkit.org/show_bug.cgi?id=220778
     5
     6        Reviewed by Youenn Fablet.
     7
     8        * web-platform-tests/url/a-element-expected.txt:
     9        * web-platform-tests/url/a-element-origin-expected.txt:
     10        * web-platform-tests/url/a-element-origin-xhtml-expected.txt:
     11        * web-platform-tests/url/a-element-xhtml-expected.txt:
     12        * web-platform-tests/url/failure-expected.txt:
     13        * web-platform-tests/url/resources/urltestdata.json:
     14        * web-platform-tests/url/url-constructor-expected.txt:
     15        * web-platform-tests/url/url-origin-expected.txt:
     16
    1172021-01-26  Rob Buis  <rbuis@igalia.com>
    218
  • trunk/LayoutTests/imported/w3c/web-platform-tests/url/a-element-expected.txt

    r268853 r271899  
    368368PASS Parsing: <non-special://a>b> against <about:blank>
    369369PASS Parsing: <non-special://a^b> against <about:blank>
    370 PASS Parsing: <http://!"$&'()*+,-.;=_`{|}~/> against <about:blank>
    371 PASS Parsing: <sc://!"$&'()*+,-.;=_`{|}~/> against <about:blank>
     370PASS Parsing: <http://!"$&'()*+,-.;=_`{}~/> against <about:blank>
     371PASS Parsing: <sc://!"$&'()*+,-.;=_`{}~/> against <about:blank>
    372372PASS Parsing: <ftp://example.com%80/> against <about:blank>
    373373PASS Parsing: <ftp://example.com%A0/> against <about:blank>
     
    415415PASS Parsing: <file:///C%3A/> against <about:blank>
    416416PASS Parsing: <file:///C%7C/> against <about:blank>
     417PASS Parsing: <file://%43%3A> against <about:blank>
     418PASS Parsing: <file://%43%7C> against <about:blank>
     419PASS Parsing: <file://%43|> against <about:blank>
     420PASS Parsing: <file://C%7C> against <about:blank>
     421PASS Parsing: <file://%43%7C/> against <about:blank>
     422PASS Parsing: <https://%43%7C/> against <about:blank>
     423PASS Parsing: <asdf://%43|/> against <about:blank>
     424PASS Parsing: <asdf://%43%7C/> against <about:blank>
    417425PASS Parsing: <pix/submit.gif> against <file:///C:/Users/Domenic/Dropbox/GitHub/tmpvar/jsdom/test/level2/html/files/anchor.html>
    418426PASS Parsing: <..> against <file:///C:/>
  • trunk/LayoutTests/imported/w3c/web-platform-tests/url/a-element-origin-expected.txt

    r267963 r271899  
    264264FAIL Parsing origin: <wow:￿> against <about:blank> assert_equals: origin expected "null" but got "wow://"
    265265PASS Parsing origin: <http://example.com/U+d800�U+dffeU+dfff﷐﷏﷯ﷰ￾￿?U+d800�U+dffeU+dfff﷐﷏﷯ﷰ￾￿> against <about:blank>
    266 PASS Parsing origin: <http://!"$&'()*+,-.;=_`{|}~/> against <about:blank>
    267 FAIL Parsing origin: <sc://!"$&'()*+,-.;=_`{|}~/> against <about:blank> assert_equals: origin expected "null" but got "sc://%1f!\"$&'()*+,-.;=_`{|}~"
     266PASS Parsing origin: <http://!"$&'()*+,-.;=_`{}~/> against <about:blank>
     267FAIL Parsing origin: <sc://!"$&'()*+,-.;=_`{}~/> against <about:blank> assert_equals: origin expected "null" but got "sc://%1f!\"$&'()*+,-.;=_`{}~"
    268268PASS Parsing origin: <ftp://%e2%98%83> against <about:blank>
    269269PASS Parsing origin: <https://%e2%98%83> against <about:blank>
     
    298298PASS Parsing origin: <http://256.256.256.256.256> against <http://other.com/>
    299299PASS Parsing origin: <https://0x.0x.0> against <about:blank>
     300FAIL Parsing origin: <asdf://%43%7C/> against <about:blank> assert_equals: origin expected "null" but got "asdf://%43%7c"
    300301PASS Parsing origin: <http://[1:0::]> against <http://example.net/>
    301302FAIL Parsing origin: <sc://ñ> against <about:blank> assert_equals: origin expected "null" but got "sc://%c3%b1"
  • trunk/LayoutTests/imported/w3c/web-platform-tests/url/a-element-origin-xhtml-expected.txt

    r267963 r271899  
    264264FAIL Parsing origin: <wow:￿> against <about:blank> assert_equals: origin expected "null" but got "wow://"
    265265PASS Parsing origin: <http://example.com/U+d800�U+dffeU+dfff﷐﷏﷯ﷰ￾￿?U+d800�U+dffeU+dfff﷐﷏﷯ﷰ￾￿> against <about:blank>
    266 PASS Parsing origin: <http://!"$&'()*+,-.;=_`{|}~/> against <about:blank>
    267 FAIL Parsing origin: <sc://!"$&'()*+,-.;=_`{|}~/> against <about:blank> assert_equals: origin expected "null" but got "sc://%1f!\"$&'()*+,-.;=_`{|}~"
     266PASS Parsing origin: <http://!"$&'()*+,-.;=_`{}~/> against <about:blank>
     267FAIL Parsing origin: <sc://!"$&'()*+,-.;=_`{}~/> against <about:blank> assert_equals: origin expected "null" but got "sc://%1f!\"$&'()*+,-.;=_`{}~"
    268268PASS Parsing origin: <ftp://%e2%98%83> against <about:blank>
    269269PASS Parsing origin: <https://%e2%98%83> against <about:blank>
     
    298298PASS Parsing origin: <http://256.256.256.256.256> against <http://other.com/>
    299299PASS Parsing origin: <https://0x.0x.0> against <about:blank>
     300FAIL Parsing origin: <asdf://%43%7C/> against <about:blank> assert_equals: origin expected "null" but got "asdf://%43%7c"
    300301PASS Parsing origin: <http://[1:0::]> against <http://example.net/>
    301302FAIL Parsing origin: <sc://ñ> against <about:blank> assert_equals: origin expected "null" but got "sc://%c3%b1"
  • trunk/LayoutTests/imported/w3c/web-platform-tests/url/a-element-xhtml-expected.txt

    r268853 r271899  
    368368PASS Parsing: <non-special://a>b> against <about:blank>
    369369PASS Parsing: <non-special://a^b> against <about:blank>
    370 PASS Parsing: <http://!"$&'()*+,-.;=_`{|}~/> against <about:blank>
    371 PASS Parsing: <sc://!"$&'()*+,-.;=_`{|}~/> against <about:blank>
     370PASS Parsing: <http://!"$&'()*+,-.;=_`{}~/> against <about:blank>
     371PASS Parsing: <sc://!"$&'()*+,-.;=_`{}~/> against <about:blank>
    372372PASS Parsing: <ftp://example.com%80/> against <about:blank>
    373373PASS Parsing: <ftp://example.com%A0/> against <about:blank>
     
    415415PASS Parsing: <file:///C%3A/> against <about:blank>
    416416PASS Parsing: <file:///C%7C/> against <about:blank>
     417PASS Parsing: <file://%43%3A> against <about:blank>
     418PASS Parsing: <file://%43%7C> against <about:blank>
     419PASS Parsing: <file://%43|> against <about:blank>
     420PASS Parsing: <file://C%7C> against <about:blank>
     421PASS Parsing: <file://%43%7C/> against <about:blank>
     422PASS Parsing: <https://%43%7C/> against <about:blank>
     423PASS Parsing: <asdf://%43|/> against <about:blank>
     424PASS Parsing: <asdf://%43%7C/> against <about:blank>
    417425PASS Parsing: <pix/submit.gif> against <file:///C:/Users/Domenic/Dropbox/GitHub/tmpvar/jsdom/test/level2/html/files/anchor.html>
    418426PASS Parsing: <..> against <file:///C:/>
  • trunk/LayoutTests/imported/w3c/web-platform-tests/url/failure-expected.txt

    r268479 r271899  
    269269FAIL Location's href: https://256.0.0.1/test should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
    270270PASS window.open(): https://256.0.0.1/test should throw
     271PASS URL's constructor's base argument: file://%43%3A should throw
     272PASS URL's href: file://%43%3A should throw
     273PASS XHR: file://%43%3A should throw
     274PASS sendBeacon(): file://%43%3A should throw
     275FAIL Location's href: file://%43%3A should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
     276PASS window.open(): file://%43%3A should throw
     277PASS URL's constructor's base argument: file://%43%7C should throw
     278PASS URL's href: file://%43%7C should throw
     279PASS XHR: file://%43%7C should throw
     280PASS sendBeacon(): file://%43%7C should throw
     281FAIL Location's href: file://%43%7C should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
     282PASS window.open(): file://%43%7C should throw
     283PASS URL's constructor's base argument: file://%43| should throw
     284PASS URL's href: file://%43| should throw
     285PASS XHR: file://%43| should throw
     286PASS sendBeacon(): file://%43| should throw
     287FAIL Location's href: file://%43| should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
     288PASS window.open(): file://%43| should throw
     289PASS URL's constructor's base argument: file://C%7C should throw
     290PASS URL's href: file://C%7C should throw
     291PASS XHR: file://C%7C should throw
     292PASS sendBeacon(): file://C%7C should throw
     293FAIL Location's href: file://C%7C should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
     294PASS window.open(): file://C%7C should throw
     295PASS URL's constructor's base argument: file://%43%7C/ should throw
     296PASS URL's href: file://%43%7C/ should throw
     297PASS XHR: file://%43%7C/ should throw
     298PASS sendBeacon(): file://%43%7C/ should throw
     299FAIL Location's href: file://%43%7C/ should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
     300PASS window.open(): file://%43%7C/ should throw
     301PASS URL's constructor's base argument: https://%43%7C/ should throw
     302PASS URL's href: https://%43%7C/ should throw
     303PASS XHR: https://%43%7C/ should throw
     304PASS sendBeacon(): https://%43%7C/ should throw
     305FAIL Location's href: https://%43%7C/ should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
     306PASS window.open(): https://%43%7C/ should throw
     307PASS URL's constructor's base argument: asdf://%43|/ should throw
     308PASS URL's href: asdf://%43|/ should throw
     309PASS XHR: asdf://%43|/ should throw
     310PASS sendBeacon(): asdf://%43|/ should throw
     311FAIL Location's href: asdf://%43|/ should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
     312PASS window.open(): asdf://%43|/ should throw
    271313PASS URL's constructor's base argument: \\\.\Y: should throw
    272314PASS URL's href: \\\.\Y: should throw
  • trunk/LayoutTests/imported/w3c/web-platform-tests/url/resources/urltestdata.json

    r268853 r271899  
    46834683  "Allowed host code points",
    46844684  {
    4685     "input": "http://\u001F!\"$&'()*+,-.;=_`{|}~/",
    4686     "base": "about:blank",
    4687     "href": "http://\u001F!\"$&'()*+,-.;=_`{|}~/",
    4688     "origin": "http://\u001F!\"$&'()*+,-.;=_`{|}~",
    4689     "protocol": "http:",
    4690     "username": "",
    4691     "password": "",
    4692     "host": "\u001F!\"$&'()*+,-.;=_`{|}~",
    4693     "hostname": "\u001F!\"$&'()*+,-.;=_`{|}~",
    4694     "port": "",
    4695     "pathname": "/",
    4696     "search": "",
    4697     "hash": ""
    4698   },
    4699   {
    4700     "input": "sc://\u001F!\"$&'()*+,-.;=_`{|}~/",
    4701     "base": "about:blank",
    4702     "href": "sc://%1F!\"$&'()*+,-.;=_`{|}~/",
     4685    "input": "http://\u001F!\"$&'()*+,-.;=_`{}~/",
     4686    "base": "about:blank",
     4687    "href": "http://\u001F!\"$&'()*+,-.;=_`{}~/",
     4688    "origin": "http://\u001F!\"$&'()*+,-.;=_`{}~",
     4689    "protocol": "http:",
     4690    "username": "",
     4691    "password": "",
     4692    "host": "\u001F!\"$&'()*+,-.;=_`{}~",
     4693    "hostname": "\u001F!\"$&'()*+,-.;=_`{}~",
     4694    "port": "",
     4695    "pathname": "/",
     4696    "search": "",
     4697    "hash": ""
     4698  },
     4699  {
     4700    "input": "sc://\u001F!\"$&'()*+,-.;=_`{}~/",
     4701    "base": "about:blank",
     4702    "href": "sc://%1F!\"$&'()*+,-.;=_`{}~/",
    47034703    "origin": "null",
    47044704    "protocol": "sc:",
    47054705    "username": "",
    47064706    "password": "",
    4707     "host": "%1F!\"$&'()*+,-.;=_`{|}~",
    4708     "hostname": "%1F!\"$&'()*+,-.;=_`{|}~",
     4707    "host": "%1F!\"$&'()*+,-.;=_`{}~",
     4708    "hostname": "%1F!\"$&'()*+,-.;=_`{}~",
    47094709    "port": "",
    47104710    "pathname": "/",
     
    52005200    "port": "",
    52015201    "pathname": "/C%7C/",
     5202    "search": "",
     5203    "hash": ""
     5204  },
     5205  {
     5206    "input": "file://%43%3A",
     5207    "base": "about:blank",
     5208    "failure": true
     5209  },
     5210  {
     5211    "input": "file://%43%7C",
     5212    "base": "about:blank",
     5213    "failure": true
     5214  },
     5215  {
     5216    "input": "file://%43|",
     5217    "base": "about:blank",
     5218    "failure": true
     5219  },
     5220  {
     5221    "input": "file://C%7C",
     5222    "base": "about:blank",
     5223    "failure": true
     5224  },
     5225  {
     5226    "input": "file://%43%7C/",
     5227    "base": "about:blank",
     5228    "failure": true
     5229  },
     5230  {
     5231    "input": "https://%43%7C/",
     5232    "base": "about:blank",
     5233    "failure": true
     5234  },
     5235  {
     5236    "input": "asdf://%43|/",
     5237    "base": "about:blank",
     5238    "failure": true
     5239  },
     5240  {
     5241    "input": "asdf://%43%7C/",
     5242    "base": "about:blank",
     5243    "href": "asdf://%43%7C/",
     5244    "origin": "null",
     5245    "protocol": "asdf:",
     5246    "username": "",
     5247    "password": "",
     5248    "host": "%43%7C",
     5249    "hostname": "%43%7C",
     5250    "port": "",
     5251    "pathname": "/",
    52025252    "search": "",
    52035253    "hash": ""
  • trunk/LayoutTests/imported/w3c/web-platform-tests/url/url-constructor-expected.txt

    r268853 r271899  
    367367PASS Parsing: <non-special://a>b> against <about:blank>
    368368PASS Parsing: <non-special://a^b> against <about:blank>
    369 PASS Parsing: <http://!"$&'()*+,-.;=_`{|}~/> against <about:blank>
    370 PASS Parsing: <sc://!"$&'()*+,-.;=_`{|}~/> against <about:blank>
     369PASS Parsing: <http://!"$&'()*+,-.;=_`{}~/> against <about:blank>
     370PASS Parsing: <sc://!"$&'()*+,-.;=_`{}~/> against <about:blank>
    371371PASS Parsing: <ftp://example.com%80/> against <about:blank>
    372372PASS Parsing: <ftp://example.com%A0/> against <about:blank>
     
    414414PASS Parsing: <file:///C%3A/> against <about:blank>
    415415PASS Parsing: <file:///C%7C/> against <about:blank>
     416PASS Parsing: <file://%43%3A> against <about:blank>
     417PASS Parsing: <file://%43%7C> against <about:blank>
     418PASS Parsing: <file://%43|> against <about:blank>
     419PASS Parsing: <file://C%7C> against <about:blank>
     420PASS Parsing: <file://%43%7C/> against <about:blank>
     421PASS Parsing: <https://%43%7C/> against <about:blank>
     422PASS Parsing: <asdf://%43|/> against <about:blank>
     423PASS Parsing: <asdf://%43%7C/> against <about:blank>
    416424PASS Parsing: <pix/submit.gif> against <file:///C:/Users/Domenic/Dropbox/GitHub/tmpvar/jsdom/test/level2/html/files/anchor.html>
    417425PASS Parsing: <..> against <file:///C:/>
  • trunk/LayoutTests/imported/w3c/web-platform-tests/url/url-origin-expected.txt

    r267963 r271899  
    263263FAIL Origin parsing: <wow:￿> against <about:blank> assert_equals: origin expected "null" but got "wow://"
    264264PASS Origin parsing: <http://example.com/U+d800�U+dffeU+dfff﷐﷏﷯ﷰ￾￿?U+d800�U+dffeU+dfff﷐﷏﷯ﷰ￾￿> against <about:blank>
    265 PASS Origin parsing: <http://!"$&'()*+,-.;=_`{|}~/> against <about:blank>
    266 FAIL Origin parsing: <sc://!"$&'()*+,-.;=_`{|}~/> against <about:blank> assert_equals: origin expected "null" but got "sc://%1f!\"$&'()*+,-.;=_`{|}~"
     265PASS Origin parsing: <http://!"$&'()*+,-.;=_`{}~/> against <about:blank>
     266FAIL Origin parsing: <sc://!"$&'()*+,-.;=_`{}~/> against <about:blank> assert_equals: origin expected "null" but got "sc://%1f!\"$&'()*+,-.;=_`{}~"
    267267PASS Origin parsing: <ftp://%e2%98%83> against <about:blank>
    268268PASS Origin parsing: <https://%e2%98%83> against <about:blank>
     
    297297PASS Origin parsing: <http://256.256.256.256.256> against <http://other.com/>
    298298PASS Origin parsing: <https://0x.0x.0> against <about:blank>
     299FAIL Origin parsing: <asdf://%43%7C/> against <about:blank> assert_equals: origin expected "null" but got "asdf://%43%7c"
    299300PASS Origin parsing: <http://[1:0::]> against <http://example.net/>
    300301FAIL Origin parsing: <sc://ñ> against <about:blank> assert_equals: origin expected "null" but got "sc://%c3%b1"
  • trunk/Source/WTF/ChangeLog

    r271806 r271899  
     12021-01-26  Alex Christensen  <achristensen@webkit.org>
     2
     3        Forbid '|' in URL hosts
     4        https://bugs.webkit.org/show_bug.cgi?id=220778
     5
     6        Reviewed by Youenn Fablet.
     7
     8        This is one of the proposed solutions to https://github.com/whatwg/url/issues/559
     9        and RFC 3986 and 3987 forbid such characters, so let's try forbidding it.
     10
     11        * wtf/URLParser.cpp:
     12        (WTF::isC0Control):
     13        (WTF::isForbiddenHostCodePoint):
     14
    1152021-01-25  Chris Dumez  <cdumez@apple.com>
    216
  • trunk/Source/WTF/wtf/URLParser.cpp

    r270818 r271899  
    187187    ValidScheme, // 'z'
    188188    UserInfo | Default, // '{'
    189     UserInfo, // '|'
     189    UserInfo | ForbiddenHost, // '|'
    190190    UserInfo | Default, // '}'
    191191    0, // '~'
     
    331331template<typename CharacterType> ALWAYS_INLINE static bool isSlashQuestionOrHash(CharacterType character) { return character <= '\\' && characterClassTable[character] & SlashQuestionOrHash; }
    332332template<typename CharacterType> ALWAYS_INLINE static bool isValidSchemeCharacter(CharacterType character) { return character <= 'z' && characterClassTable[character] & ValidScheme; }
    333 template<typename CharacterType> ALWAYS_INLINE static bool isForbiddenHostCodePoint(CharacterType character) { return character <= '^' && characterClassTable[character] & ForbiddenHost; }
     333template<typename CharacterType> ALWAYS_INLINE static bool isForbiddenHostCodePoint(CharacterType character) { return character <= '|' && characterClassTable[character] & ForbiddenHost; }
    334334ALWAYS_INLINE static bool shouldPercentEncodeQueryByte(uint8_t byte, const bool& urlIsSpecial)
    335335{
Note: See TracChangeset for help on using the changeset viewer.