Changeset 269459 in webkit


Ignore:
Timestamp:
Nov 5, 2020 12:05:35 PM (21 months ago)
Author:
youenn@apple.com
Message:

WebSocket constructor should not throw in case port is blocked
https://bugs.webkit.org/show_bug.cgi?id=218617
LayoutTests/imported/w3c:

Reviewed by Alex Christensen.

  • web-platform-tests/websockets/Create-blocked-port.any-expected.txt:
  • web-platform-tests/websockets/Create-blocked-port.any.worker-expected.txt:

Source/WebCore:

Reviewed by Alex Christensen.

Update as per spec, see https://github.com/web-platform-tests/wpt/pull/5212.
Covered by existing tests.

  • Modules/websockets/WebSocket.cpp:

(WebCore::WebSocket::connect):

LayoutTests:

<rdar://problem/71080398>

Reviewed by Alex Christensen.

Removing no longer valid test, correct version covered by WPT test.

  • http/tests/websocket/tests/hybi/url-parsing-expected.txt:
  • http/tests/websocket/tests/hybi/url-parsing.html:
Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r269452 r269459  
     12020-11-05  Youenn Fablet  <youenn@apple.com>
     2
     3        WebSocket constructor should not throw in case port is blocked
     4        https://bugs.webkit.org/show_bug.cgi?id=218617
     5        <rdar://problem/71080398>
     6
     7        Reviewed by Alex Christensen.
     8
     9        Removing no longer valid test, correct version covered by WPT test.
     10
     11        * http/tests/websocket/tests/hybi/url-parsing-expected.txt:
     12        * http/tests/websocket/tests/hybi/url-parsing.html:
     13
    1142020-11-05  Chris Dumez  <cdumez@apple.com>
    215
  • trunk/LayoutTests/http/tests/websocket/tests/hybi/url-parsing-expected.txt

    r259900 r269459  
    33CONSOLE MESSAGE: Wrong url scheme for WebSocket http://127.0.0.1:8000/applet
    44CONSOLE MESSAGE: Wrong url scheme for WebSocket javascript:a
    5 CONSOLE MESSAGE: WebSocket port 25 blocked
    65CONSOLE MESSAGE: URL has fragment component ws://127.0.0.1/path#
    76CONSOLE MESSAGE: URL has fragment component ws://127.0.0.1/path#fragment
     
    1514PASS new WebSocket("/applet") threw exception SyntaxError: The string did not match the expected pattern..
    1615PASS new WebSocket("javascript:a") threw exception SyntaxError: The string did not match the expected pattern..
    17 PASS new WebSocket("ws://127.0.0.1:25/") threw exception SecurityError: The operation is insecure..
    1816PASS (new WebSocket("ws://127.0.0.1:8880/a/../websocket/tests/hybi/simple")).URL is "ws://127.0.0.1:8880/websocket/tests/hybi/simple"
    1917PASS (new WebSocket("ws://127.0.0.1:8880/websocket/tests/hybi/simple?")).URL is "ws://127.0.0.1:8880/websocket/tests/hybi/simple?"
  • trunk/LayoutTests/http/tests/websocket/tests/hybi/url-parsing.html

    r134221 r269459  
    2525shouldThrow('new WebSocket("javascript:a")');
    2626
    27 // UA is allowed to block access to some ports, which we do.
    28 shouldThrow('new WebSocket("ws://127.0.0.1:25/")');
    29 
    3027// Resolve the url string using the resolve a Web address algorithm.
    3128// Use 127.0.0.1:8880 and existing ws handler to make sure we don't receive unexpected response (so no console message appears)
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r269452 r269459  
     12020-11-05  Youenn Fablet  <youenn@apple.com>
     2
     3        WebSocket constructor should not throw in case port is blocked
     4        https://bugs.webkit.org/show_bug.cgi?id=218617
     5
     6        Reviewed by Alex Christensen.
     7
     8        * web-platform-tests/websockets/Create-blocked-port.any-expected.txt:
     9        * web-platform-tests/websockets/Create-blocked-port.any.worker-expected.txt:
     10
    1112020-11-05  Chris Dumez  <cdumez@apple.com>
    212
  • trunk/LayoutTests/imported/w3c/web-platform-tests/websockets/Create-blocked-port.any-expected.txt

    r269436 r269459  
    11
    22PASS Basic check
    3 FAIL WebSocket blocked port test 1 The operation is insecure.
    4 FAIL WebSocket blocked port test 7 The operation is insecure.
    5 FAIL WebSocket blocked port test 9 The operation is insecure.
    6 FAIL WebSocket blocked port test 11 The operation is insecure.
    7 FAIL WebSocket blocked port test 13 The operation is insecure.
    8 FAIL WebSocket blocked port test 15 The operation is insecure.
    9 FAIL WebSocket blocked port test 17 The operation is insecure.
    10 FAIL WebSocket blocked port test 19 The operation is insecure.
    11 FAIL WebSocket blocked port test 20 The operation is insecure.
    12 FAIL WebSocket blocked port test 21 The operation is insecure.
    13 FAIL WebSocket blocked port test 22 The operation is insecure.
    14 FAIL WebSocket blocked port test 23 The operation is insecure.
    15 FAIL WebSocket blocked port test 25 The operation is insecure.
    16 FAIL WebSocket blocked port test 37 The operation is insecure.
    17 FAIL WebSocket blocked port test 42 The operation is insecure.
    18 FAIL WebSocket blocked port test 43 The operation is insecure.
    19 FAIL WebSocket blocked port test 53 The operation is insecure.
    20 FAIL WebSocket blocked port test 77 The operation is insecure.
    21 FAIL WebSocket blocked port test 79 The operation is insecure.
    22 FAIL WebSocket blocked port test 87 The operation is insecure.
    23 FAIL WebSocket blocked port test 95 The operation is insecure.
    24 FAIL WebSocket blocked port test 101 The operation is insecure.
    25 FAIL WebSocket blocked port test 102 The operation is insecure.
    26 FAIL WebSocket blocked port test 103 The operation is insecure.
    27 FAIL WebSocket blocked port test 104 The operation is insecure.
    28 FAIL WebSocket blocked port test 109 The operation is insecure.
    29 FAIL WebSocket blocked port test 110 The operation is insecure.
    30 FAIL WebSocket blocked port test 111 The operation is insecure.
    31 FAIL WebSocket blocked port test 113 The operation is insecure.
    32 FAIL WebSocket blocked port test 115 The operation is insecure.
    33 FAIL WebSocket blocked port test 117 The operation is insecure.
    34 FAIL WebSocket blocked port test 119 The operation is insecure.
    35 FAIL WebSocket blocked port test 123 The operation is insecure.
    36 FAIL WebSocket blocked port test 135 The operation is insecure.
    37 FAIL WebSocket blocked port test 139 The operation is insecure.
    38 FAIL WebSocket blocked port test 143 The operation is insecure.
    39 FAIL WebSocket blocked port test 179 The operation is insecure.
    40 FAIL WebSocket blocked port test 389 The operation is insecure.
    41 FAIL WebSocket blocked port test 427 The operation is insecure.
    42 FAIL WebSocket blocked port test 465 The operation is insecure.
    43 FAIL WebSocket blocked port test 512 The operation is insecure.
    44 FAIL WebSocket blocked port test 513 The operation is insecure.
    45 FAIL WebSocket blocked port test 514 The operation is insecure.
    46 FAIL WebSocket blocked port test 515 The operation is insecure.
    47 FAIL WebSocket blocked port test 526 The operation is insecure.
    48 FAIL WebSocket blocked port test 530 The operation is insecure.
    49 FAIL WebSocket blocked port test 531 The operation is insecure.
    50 FAIL WebSocket blocked port test 532 The operation is insecure.
    51 FAIL WebSocket blocked port test 540 The operation is insecure.
    52 FAIL WebSocket blocked port test 548 The operation is insecure.
    53 FAIL WebSocket blocked port test 556 The operation is insecure.
    54 FAIL WebSocket blocked port test 563 The operation is insecure.
    55 FAIL WebSocket blocked port test 587 The operation is insecure.
    56 FAIL WebSocket blocked port test 601 The operation is insecure.
    57 FAIL WebSocket blocked port test 636 The operation is insecure.
    58 FAIL WebSocket blocked port test 993 The operation is insecure.
    59 FAIL WebSocket blocked port test 995 The operation is insecure.
    60 FAIL WebSocket blocked port test 2049 The operation is insecure.
    61 FAIL WebSocket blocked port test 3659 The operation is insecure.
    62 FAIL WebSocket blocked port test 4045 The operation is insecure.
    63 FAIL WebSocket blocked port test 5060 The operation is insecure.
    64 FAIL WebSocket blocked port test 5061 The operation is insecure.
    65 FAIL WebSocket blocked port test 6000 The operation is insecure.
    66 FAIL WebSocket blocked port test 6665 The operation is insecure.
    67 FAIL WebSocket blocked port test 6666 The operation is insecure.
    68 FAIL WebSocket blocked port test 6667 The operation is insecure.
    69 FAIL WebSocket blocked port test 6668 The operation is insecure.
    70 FAIL WebSocket blocked port test 6669 The operation is insecure.
    71 FAIL WebSocket blocked port test 6697 The operation is insecure.
     3PASS WebSocket blocked port test 1
     4PASS WebSocket blocked port test 7
     5PASS WebSocket blocked port test 9
     6PASS WebSocket blocked port test 11
     7PASS WebSocket blocked port test 13
     8PASS WebSocket blocked port test 15
     9PASS WebSocket blocked port test 17
     10PASS WebSocket blocked port test 19
     11PASS WebSocket blocked port test 20
     12PASS WebSocket blocked port test 21
     13PASS WebSocket blocked port test 22
     14PASS WebSocket blocked port test 23
     15PASS WebSocket blocked port test 25
     16PASS WebSocket blocked port test 37
     17PASS WebSocket blocked port test 42
     18PASS WebSocket blocked port test 43
     19PASS WebSocket blocked port test 53
     20PASS WebSocket blocked port test 77
     21PASS WebSocket blocked port test 79
     22PASS WebSocket blocked port test 87
     23PASS WebSocket blocked port test 95
     24PASS WebSocket blocked port test 101
     25PASS WebSocket blocked port test 102
     26PASS WebSocket blocked port test 103
     27PASS WebSocket blocked port test 104
     28PASS WebSocket blocked port test 109
     29PASS WebSocket blocked port test 110
     30PASS WebSocket blocked port test 111
     31PASS WebSocket blocked port test 113
     32PASS WebSocket blocked port test 115
     33PASS WebSocket blocked port test 117
     34PASS WebSocket blocked port test 119
     35PASS WebSocket blocked port test 123
     36PASS WebSocket blocked port test 135
     37PASS WebSocket blocked port test 139
     38PASS WebSocket blocked port test 143
     39PASS WebSocket blocked port test 179
     40PASS WebSocket blocked port test 389
     41PASS WebSocket blocked port test 427
     42PASS WebSocket blocked port test 465
     43PASS WebSocket blocked port test 512
     44PASS WebSocket blocked port test 513
     45PASS WebSocket blocked port test 514
     46PASS WebSocket blocked port test 515
     47PASS WebSocket blocked port test 526
     48PASS WebSocket blocked port test 530
     49PASS WebSocket blocked port test 531
     50PASS WebSocket blocked port test 532
     51PASS WebSocket blocked port test 540
     52PASS WebSocket blocked port test 548
     53PASS WebSocket blocked port test 556
     54PASS WebSocket blocked port test 563
     55PASS WebSocket blocked port test 587
     56PASS WebSocket blocked port test 601
     57PASS WebSocket blocked port test 636
     58PASS WebSocket blocked port test 993
     59PASS WebSocket blocked port test 995
     60PASS WebSocket blocked port test 2049
     61PASS WebSocket blocked port test 3659
     62PASS WebSocket blocked port test 4045
     63PASS WebSocket blocked port test 5060
     64PASS WebSocket blocked port test 5061
     65PASS WebSocket blocked port test 6000
     66PASS WebSocket blocked port test 6665
     67PASS WebSocket blocked port test 6666
     68PASS WebSocket blocked port test 6667
     69PASS WebSocket blocked port test 6668
     70PASS WebSocket blocked port test 6669
     71PASS WebSocket blocked port test 6697
    7272
  • trunk/LayoutTests/imported/w3c/web-platform-tests/websockets/Create-blocked-port.any.worker-expected.txt

    r269436 r269459  
    11
    22PASS Basic check
    3 FAIL WebSocket blocked port test 1 The operation is insecure.
    4 FAIL WebSocket blocked port test 7 The operation is insecure.
    5 FAIL WebSocket blocked port test 9 The operation is insecure.
    6 FAIL WebSocket blocked port test 11 The operation is insecure.
    7 FAIL WebSocket blocked port test 13 The operation is insecure.
    8 FAIL WebSocket blocked port test 15 The operation is insecure.
    9 FAIL WebSocket blocked port test 17 The operation is insecure.
    10 FAIL WebSocket blocked port test 19 The operation is insecure.
    11 FAIL WebSocket blocked port test 20 The operation is insecure.
    12 FAIL WebSocket blocked port test 21 The operation is insecure.
    13 FAIL WebSocket blocked port test 22 The operation is insecure.
    14 FAIL WebSocket blocked port test 23 The operation is insecure.
    15 FAIL WebSocket blocked port test 25 The operation is insecure.
    16 FAIL WebSocket blocked port test 37 The operation is insecure.
    17 FAIL WebSocket blocked port test 42 The operation is insecure.
    18 FAIL WebSocket blocked port test 43 The operation is insecure.
    19 FAIL WebSocket blocked port test 53 The operation is insecure.
    20 FAIL WebSocket blocked port test 77 The operation is insecure.
    21 FAIL WebSocket blocked port test 79 The operation is insecure.
    22 FAIL WebSocket blocked port test 87 The operation is insecure.
    23 FAIL WebSocket blocked port test 95 The operation is insecure.
    24 FAIL WebSocket blocked port test 101 The operation is insecure.
    25 FAIL WebSocket blocked port test 102 The operation is insecure.
    26 FAIL WebSocket blocked port test 103 The operation is insecure.
    27 FAIL WebSocket blocked port test 104 The operation is insecure.
    28 FAIL WebSocket blocked port test 109 The operation is insecure.
    29 FAIL WebSocket blocked port test 110 The operation is insecure.
    30 FAIL WebSocket blocked port test 111 The operation is insecure.
    31 FAIL WebSocket blocked port test 113 The operation is insecure.
    32 FAIL WebSocket blocked port test 115 The operation is insecure.
    33 FAIL WebSocket blocked port test 117 The operation is insecure.
    34 FAIL WebSocket blocked port test 119 The operation is insecure.
    35 FAIL WebSocket blocked port test 123 The operation is insecure.
    36 FAIL WebSocket blocked port test 135 The operation is insecure.
    37 FAIL WebSocket blocked port test 139 The operation is insecure.
    38 FAIL WebSocket blocked port test 143 The operation is insecure.
    39 FAIL WebSocket blocked port test 179 The operation is insecure.
    40 FAIL WebSocket blocked port test 389 The operation is insecure.
    41 FAIL WebSocket blocked port test 427 The operation is insecure.
    42 FAIL WebSocket blocked port test 465 The operation is insecure.
    43 FAIL WebSocket blocked port test 512 The operation is insecure.
    44 FAIL WebSocket blocked port test 513 The operation is insecure.
    45 FAIL WebSocket blocked port test 514 The operation is insecure.
    46 FAIL WebSocket blocked port test 515 The operation is insecure.
    47 FAIL WebSocket blocked port test 526 The operation is insecure.
    48 FAIL WebSocket blocked port test 530 The operation is insecure.
    49 FAIL WebSocket blocked port test 531 The operation is insecure.
    50 FAIL WebSocket blocked port test 532 The operation is insecure.
    51 FAIL WebSocket blocked port test 540 The operation is insecure.
    52 FAIL WebSocket blocked port test 548 The operation is insecure.
    53 FAIL WebSocket blocked port test 556 The operation is insecure.
    54 FAIL WebSocket blocked port test 563 The operation is insecure.
    55 FAIL WebSocket blocked port test 587 The operation is insecure.
    56 FAIL WebSocket blocked port test 601 The operation is insecure.
    57 FAIL WebSocket blocked port test 636 The operation is insecure.
    58 FAIL WebSocket blocked port test 993 The operation is insecure.
    59 FAIL WebSocket blocked port test 995 The operation is insecure.
    60 FAIL WebSocket blocked port test 2049 The operation is insecure.
    61 FAIL WebSocket blocked port test 3659 The operation is insecure.
    62 FAIL WebSocket blocked port test 4045 The operation is insecure.
    63 FAIL WebSocket blocked port test 5060 The operation is insecure.
    64 FAIL WebSocket blocked port test 5061 The operation is insecure.
    65 FAIL WebSocket blocked port test 6000 The operation is insecure.
    66 FAIL WebSocket blocked port test 6665 The operation is insecure.
    67 FAIL WebSocket blocked port test 6666 The operation is insecure.
    68 FAIL WebSocket blocked port test 6667 The operation is insecure.
    69 FAIL WebSocket blocked port test 6668 The operation is insecure.
    70 FAIL WebSocket blocked port test 6669 The operation is insecure.
    71 FAIL WebSocket blocked port test 6697 The operation is insecure.
     3PASS WebSocket blocked port test 1
     4PASS WebSocket blocked port test 7
     5PASS WebSocket blocked port test 9
     6PASS WebSocket blocked port test 11
     7PASS WebSocket blocked port test 13
     8PASS WebSocket blocked port test 15
     9PASS WebSocket blocked port test 17
     10PASS WebSocket blocked port test 19
     11PASS WebSocket blocked port test 20
     12PASS WebSocket blocked port test 21
     13PASS WebSocket blocked port test 22
     14PASS WebSocket blocked port test 23
     15PASS WebSocket blocked port test 25
     16PASS WebSocket blocked port test 37
     17PASS WebSocket blocked port test 42
     18PASS WebSocket blocked port test 43
     19PASS WebSocket blocked port test 53
     20PASS WebSocket blocked port test 77
     21PASS WebSocket blocked port test 79
     22PASS WebSocket blocked port test 87
     23PASS WebSocket blocked port test 95
     24PASS WebSocket blocked port test 101
     25PASS WebSocket blocked port test 102
     26PASS WebSocket blocked port test 103
     27PASS WebSocket blocked port test 104
     28PASS WebSocket blocked port test 109
     29PASS WebSocket blocked port test 110
     30PASS WebSocket blocked port test 111
     31PASS WebSocket blocked port test 113
     32PASS WebSocket blocked port test 115
     33PASS WebSocket blocked port test 117
     34PASS WebSocket blocked port test 119
     35PASS WebSocket blocked port test 123
     36PASS WebSocket blocked port test 135
     37PASS WebSocket blocked port test 139
     38PASS WebSocket blocked port test 143
     39PASS WebSocket blocked port test 179
     40PASS WebSocket blocked port test 389
     41PASS WebSocket blocked port test 427
     42PASS WebSocket blocked port test 465
     43PASS WebSocket blocked port test 512
     44PASS WebSocket blocked port test 513
     45PASS WebSocket blocked port test 514
     46PASS WebSocket blocked port test 515
     47PASS WebSocket blocked port test 526
     48PASS WebSocket blocked port test 530
     49PASS WebSocket blocked port test 531
     50PASS WebSocket blocked port test 532
     51PASS WebSocket blocked port test 540
     52PASS WebSocket blocked port test 548
     53PASS WebSocket blocked port test 556
     54PASS WebSocket blocked port test 563
     55PASS WebSocket blocked port test 587
     56PASS WebSocket blocked port test 601
     57PASS WebSocket blocked port test 636
     58PASS WebSocket blocked port test 993
     59PASS WebSocket blocked port test 995
     60PASS WebSocket blocked port test 2049
     61PASS WebSocket blocked port test 3659
     62PASS WebSocket blocked port test 4045
     63PASS WebSocket blocked port test 5060
     64PASS WebSocket blocked port test 5061
     65PASS WebSocket blocked port test 6000
     66PASS WebSocket blocked port test 6665
     67PASS WebSocket blocked port test 6666
     68PASS WebSocket blocked port test 6667
     69PASS WebSocket blocked port test 6668
     70PASS WebSocket blocked port test 6669
     71PASS WebSocket blocked port test 6697
    7272
  • trunk/Source/WebCore/ChangeLog

    r269458 r269459  
     12020-11-05  Youenn Fablet  <youenn@apple.com>
     2
     3        WebSocket constructor should not throw in case port is blocked
     4        https://bugs.webkit.org/show_bug.cgi?id=218617
     5
     6        Reviewed by Alex Christensen.
     7
     8        Update as per spec, see https://github.com/web-platform-tests/wpt/pull/5212.
     9        Covered by existing tests.
     10
     11        * Modules/websockets/WebSocket.cpp:
     12        (WebCore::WebSocket::connect):
     13
    1142020-11-05  Simon Fraser  <simon.fraser@apple.com>
    215
  • trunk/Source/WebCore/Modules/websockets/WebSocket.cpp

    r266168 r269459  
    262262            message = "WebSocket without port blocked"_s;
    263263        context.addConsoleMessage(MessageSource::JS, MessageLevel::Error, message);
    264         m_state = CLOSED;
    265         return Exception { SecurityError };
     264        failAsynchronously();
     265        return { };
    266266    }
    267267
Note: See TracChangeset for help on using the changeset viewer.