Changeset 144037 in webkit


Ignore:
Timestamp:
Feb 26, 2013 4:01:24 AM (11 years ago)
Author:
toyoshim@chromium.org
Message:

Add User-Agent header in opening handshake headers.
https://bugs.webkit.org/show_bug.cgi?id=110601

Reviewed by Alexey Proskuryakov.

RFC-6455 doesn't require to send User-Agent header, but allow it.
Many web application developers want to have it, and Firefox already
did it. This patch adds User-Agent header in opening handshake also in
WebKit ports.

Test: http/tests/websocket/tests/hybi/useragent-in-openinghandshake.html

Source/WebCore:

  • Modules/websockets/WebSocketHandshake.cpp:

(WebCore::WebSocketHandshake::clientHandshakeMessage):
(WebCore::WebSocketHandshake::clientHandshakeRequest):

LayoutTests:

  • http/tests/websocket/tests/hybi/sendback_ua_wsh.py: Added.

(web_socket_do_extra_handshake):
(web_socket_transfer_data):

  • http/tests/websocket/tests/hybi/useragent-in-openinghandshake-expected.txt: Added.
  • http/tests/websocket/tests/hybi/useragent-in-openinghandshake.html: Added.
Location:
trunk
Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r144035 r144037  
     12013-02-26  Takashi Toyoshima  <toyoshim@chromium.org>
     2
     3        Add User-Agent header in opening handshake headers.
     4        https://bugs.webkit.org/show_bug.cgi?id=110601
     5
     6        Reviewed by Alexey Proskuryakov.
     7
     8        RFC-6455 doesn't require to send User-Agent header, but allow it.
     9        Many web application developers want to have it, and Firefox already
     10        did it. This patch adds User-Agent header in opening handshake also in
     11        WebKit ports.
     12
     13        Test: http/tests/websocket/tests/hybi/useragent-in-openinghandshake.html
     14
     15        * http/tests/websocket/tests/hybi/sendback_ua_wsh.py: Added.
     16        (web_socket_do_extra_handshake):
     17        (web_socket_transfer_data):
     18        * http/tests/websocket/tests/hybi/useragent-in-openinghandshake-expected.txt: Added.
     19        * http/tests/websocket/tests/hybi/useragent-in-openinghandshake.html: Added.
     20
    1212013-02-26  Zan Dobersek  <zdobersek@igalia.com>
    222
  • trunk/Source/WebCore/ChangeLog

    r144036 r144037  
     12013-02-26  Takashi Toyoshima  <toyoshim@chromium.org>
     2
     3        Add User-Agent header in opening handshake headers.
     4        https://bugs.webkit.org/show_bug.cgi?id=110601
     5
     6        Reviewed by Alexey Proskuryakov.
     7
     8        RFC-6455 doesn't require to send User-Agent header, but allow it.
     9        Many web application developers want to have it, and Firefox already
     10        did it. This patch adds User-Agent header in opening handshake also in
     11        WebKit ports.
     12
     13        Test: http/tests/websocket/tests/hybi/useragent-in-openinghandshake.html
     14
     15        * Modules/websockets/WebSocketHandshake.cpp:
     16        (WebCore::WebSocketHandshake::clientHandshakeMessage):
     17        (WebCore::WebSocketHandshake::clientHandshakeRequest):
     18
    1192013-02-26  Mike West  <mkwst@chromium.org>
    220
  • trunk/Source/WebCore/Modules/websockets/WebSocketHandshake.cpp

    r131155 r144037  
    220220        fields.append("Sec-WebSocket-Extensions: " + extensionValue);
    221221
     222    // Add a User-Agent header.
     223    fields.append("User-Agent: " + m_context->userAgent(m_context->url()));
     224
    222225    // Fields in the handshake are sent by the client in a random order; the
    223226    // order is not meaningful.  Thus, it's ok to send the order we constructed
     
    264267    if (extensionValue.length())
    265268        request->addHeaderField("Sec-WebSocket-Extensions", extensionValue);
     269
     270    // Add a User-Agent header.
     271    request->addHeaderField("User-Agent", m_context->userAgent(m_context->url()));
    266272
    267273    return request.release();
Note: See TracChangeset for help on using the changeset viewer.