summaryrefslogtreecommitdiffstats
path: root/test/wpt/tests/websockets/handlers/set-cookie-secure_wsh.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/wpt/tests/websockets/handlers/set-cookie-secure_wsh.py')
-rw-r--r--test/wpt/tests/websockets/handlers/set-cookie-secure_wsh.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/wpt/tests/websockets/handlers/set-cookie-secure_wsh.py b/test/wpt/tests/websockets/handlers/set-cookie-secure_wsh.py
new file mode 100644
index 0000000..052a882
--- /dev/null
+++ b/test/wpt/tests/websockets/handlers/set-cookie-secure_wsh.py
@@ -0,0 +1,11 @@
+#!/usr/bin/python
+import urllib
+
+
+def web_socket_do_extra_handshake(request):
+ url_parts = urllib.parse.urlsplit(request.uri)
+ request.extra_headers.append(('Set-Cookie', 'ws_test_'+(url_parts.query or '')+'=test; Secure; Path=/'))
+
+def web_socket_transfer_data(request):
+ # Expect close() from user agent.
+ request.ws_stream.receive_message()