Changeset 51830 in webkit


Ignore:
Timestamp:
Dec 7, 2009 8:19:59 PM (14 years ago)
Author:
ukai@chromium.org
Message:

2009-12-07 Fumitoshi Ukai <ukai@chromium.org>

Reviewed by Alexey Proskuryakov.

Fragments now make WebSocket URL parsing fail.
https://bugs.webkit.org/show_bug.cgi?id=32144

  • websocket/tests/script-tests/url-parsing.js:
  • websocket/tests/script-tests/url-with-fragment.js: Removed.
  • websocket/tests/url-parsing-expected.txt:
  • websocket/tests/url-with-fragment-expected.txt: Removed.
  • websocket/tests/url-with-fragment.html: Removed.

2009-12-07 Fumitoshi Ukai <ukai@chromium.org>

Reviewed by Alexey Proskuryakov.

Fragments now make WebSocket URL parsing fail.
https://bugs.webkit.org/show_bug.cgi?id=32144

  • websockets/WebSocket.cpp: (WebCore::WebSocket::connect):
Location:
trunk
Files:
3 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r51829 r51830  
     12009-12-07  Fumitoshi Ukai  <ukai@chromium.org>
     2
     3        Reviewed by Alexey Proskuryakov.
     4
     5        Fragments now make WebSocket URL parsing fail.
     6        https://bugs.webkit.org/show_bug.cgi?id=32144
     7
     8        * websocket/tests/script-tests/url-parsing.js:
     9        * websocket/tests/script-tests/url-with-fragment.js: Removed.
     10        * websocket/tests/url-parsing-expected.txt:
     11        * websocket/tests/url-with-fragment-expected.txt: Removed.
     12        * websocket/tests/url-with-fragment.html: Removed.
     13
    1142009-12-07  Fumitoshi Ukai  <ukai@chromium.org>
    215
  • trunk/LayoutTests/websocket/tests/script-tests/url-parsing.js

    r51703 r51830  
    88
    99// This is what we currently do, but not what the spec says (as of Editor's Draft 1 December 2009).
    10 // The spec says that the string passed to WebScoket constructor should be returned unchanged.
    1110shouldBe('(new WebSocket("ws://127.0.0.1/a/../")).URL', '"ws://127.0.0.1/"');
     11
     12shouldBe('(new WebSocket("ws://127.0.0.1/path?")).URL', '"ws://127.0.0.1/path?"');
     13shouldBe('(new WebSocket("ws://127.0.0.1/path?k=v")).URL', '"ws://127.0.0.1/path?k=v"');
     14
     15// draft-hixie-thewebsocketprotocol-60 says If /url/ has a <fragment>
     16// component, then fail the parsing Web Socket URLs, so throw a SYNTAX_ERR
     17// exception.
     18shouldThrow('new WebSocket("ws://127.0.0.1/path#")');
     19shouldThrow('new WebSocket("ws://127.0.0.1/path#fragment")');
    1220
    1321var successfullyParsed = true;
  • trunk/LayoutTests/websocket/tests/url-parsing-expected.txt

    r51703 r51830  
    66PASS new WebSocket("ws://127.0.0.1:25/") threw exception Error: SECURITY_ERR: DOM Exception 18.
    77PASS (new WebSocket("ws://127.0.0.1/a/../")).URL is "ws://127.0.0.1/"
     8PASS (new WebSocket("ws://127.0.0.1/path?")).URL is "ws://127.0.0.1/path?"
     9PASS (new WebSocket("ws://127.0.0.1/path?k=v")).URL is "ws://127.0.0.1/path?k=v"
     10PASS new WebSocket("ws://127.0.0.1/path#") threw exception Error: SYNTAX_ERR: DOM Exception 12.
     11PASS new WebSocket("ws://127.0.0.1/path#fragment") threw exception Error: SYNTAX_ERR: DOM Exception 12.
    812PASS successfullyParsed is true
    913
  • trunk/WebCore/ChangeLog

    r51829 r51830  
     12009-12-07  Fumitoshi Ukai  <ukai@chromium.org>
     2
     3        Reviewed by Alexey Proskuryakov.
     4
     5        Fragments now make WebSocket URL parsing fail.
     6        https://bugs.webkit.org/show_bug.cgi?id=32144
     7
     8        * websockets/WebSocket.cpp:
     9        (WebCore::WebSocket::connect):
     10
    1112009-12-07  Fumitoshi Ukai  <ukai@chromium.org>
    212
  • trunk/WebCore/websockets/WebSocket.cpp

    r51703 r51830  
    131131        return;
    132132    }
     133    if (m_url.hasFragmentIdentifier()) {
     134        LOG(Network, "URL has fragment component %s", url.string().utf8().data());
     135        m_state = CLOSED;
     136        ec = SYNTAX_ERR;
     137        return;
     138    }
    133139    if (!isValidProtocolString(m_protocol)) {
    134140        LOG(Network, "Wrong protocol for WebSocket %s", m_protocol.utf8().data());
Note: See TracChangeset for help on using the changeset viewer.