Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(198)

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/websocket/set-cookie_wsh.py

Issue 2102993002: Fix WebSocket to set first party for cookies (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: a Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 # Copyright 2013, Google Inc. All rights reserved. 1 # Copyright 2013, Google Inc. All rights reserved.
2 # 2 #
3 # Redistribution and use in source and binary forms, with or without 3 # Redistribution and use in source and binary forms, with or without
4 # modification, are permitted provided that the following conditions are 4 # modification, are permitted provided that the following conditions are
5 # met: 5 # met:
6 # 6 #
7 # * Redistributions of source code must retain the above copyright 7 # * Redistributions of source code must retain the above copyright
8 # notice, this list of conditions and the following disclaimer. 8 # notice, this list of conditions and the following disclaimer.
9 # * Redistributions in binary form must reproduce the above 9 # * Redistributions in binary form must reproduce the above
10 # copyright notice, this list of conditions and the following disclaimer 10 # copyright notice, this list of conditions and the following disclaimer
(...skipping 17 matching lines...) Expand all
28 28
29 29
30 import urlparse 30 import urlparse
31 31
32 32
33 def web_socket_do_extra_handshake(request): 33 def web_socket_do_extra_handshake(request):
34 query = urlparse.urlparse(request.uri)[4] 34 query = urlparse.urlparse(request.uri)[4]
35 max_age = '' 35 max_age = ''
36 if 'clear' in urlparse.parse_qs(query): 36 if 'clear' in urlparse.parse_qs(query):
37 max_age = '; Max-Age=0' 37 max_age = '; Max-Age=0'
38 request.extra_headers.append( 38 cookies = [
39 ('Set-Cookie', 'WK-WebSocket-test-domain-pass=1; Domain=127.0.0.1' + max _age)) 39 'WK-WebSocket-test-domain-pass=1; Domain=127.0.0.1' + max_age,
40 request.extra_headers.append( 40 'WK-WebSocket-test-domain-fail=1; Domain=example.com' + max_age,
41 ('Set-Cookie', 'WK-WebSocket-test-domain-fail=1; Domain=example.com' + m ax_age)) 41 'WK-WebSocket-test-path-pass=1; Path=/' + max_age,
42 request.extra_headers.append( 42 'WK-WebSocket-test-path-fail=1; Path=/foo/bar' + max_age,
43 ('Set-Cookie', 'WK-WebSocket-test-path-pass=1; Path=/' + max_age)) 43 'WK-WebSocket-test=1' + max_age,
44 request.extra_headers.append( 44 'same-site-strict=1; SameSite=Strict' + max_age,
45 ('Set-Cookie', 'WK-WebSocket-test-path-fail=1; Path=/foo/bar' + max_age) ) 45 'same-site-lax=1; SameSite=Lax' + max_age
46 request.extra_headers.append(('Set-Cookie', 46 ]
47 'WK-WebSocket-test=1' + max_age)) 47 for value in cookies:
48 request.extra_headers.append(('Set-Cookie', value))
48 49
49 50
50 def web_socket_transfer_data(request): 51 def web_socket_transfer_data(request):
51 request.ws_stream.send_message('url = ' + request.uri) 52 request.ws_stream.send_message('url = ' + request.uri)
52 53
53 54
54 # vi:sts=4 sw=4 et 55 # vi:sts=4 sw=4 et
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698