WebSocket cookie incorrectly stored
authordbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 28 Mar 2018 21:27:44 +0000 (21:27 +0000)
committerdbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 28 Mar 2018 21:27:44 +0000 (21:27 +0000)
commit77d49dbec3d18d5a4e8768d7bed868622b930ffe
tree3aac703128823a82ac7307502b8e412740b6e1ae
parentaadebffd2b4d692a1a8dffc6be22be1479f9d275
WebSocket cookie incorrectly stored
https://bugs.webkit.org/show_bug.cgi?id=184100
<rdar://problem/37928715>

Reviewed by Brent Fulgham.

Source/WebCore:

A cookie received in a WebSocket response should be stored with respect to the
origin of the WebSocket server in order for it to be sent in a subsequent request.

Also removed a FIXME about implementing support for the long since
deprecated Set-Cookie2 header.

Test: http/tests/websocket/tests/hybi/websocket-cookie-overwrite-behavior.html

* Modules/websockets/WebSocketChannel.cpp:
(WebCore::WebSocketChannel::processBuffer):
* Modules/websockets/WebSocketHandshake.h:

LayoutTests:

* http/tests/websocket/tests/hybi/cookie_wsh.py: Added. Downloaded from
<https://github.com/w3c/pywebsocket/blob/b2e1d11086fdf00b33a0d30c504f227e7d4fa86b/src/example/cookie_wsh.py>.
(_add_set_cookie):
(web_socket_do_extra_handshake):
(web_socket_transfer_data):
* http/tests/websocket/tests/hybi/websocket-cookie-overwrite-behavior-expected.txt: Added.
* http/tests/websocket/tests/hybi/websocket-cookie-overwrite-behavior.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@230052 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/http/tests/websocket/tests/hybi/cookie_wsh.py [new file with mode: 0644]
LayoutTests/http/tests/websocket/tests/hybi/websocket-cookie-overwrite-behavior-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/websocket/tests/hybi/websocket-cookie-overwrite-behavior.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/Modules/websockets/WebSocketChannel.cpp
Source/WebCore/Modules/websockets/WebSocketHandshake.h