summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/webtransport/handlers/echo-request-headers.py
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/webtransport/handlers/echo-request-headers.py')
-rw-r--r--testing/web-platform/tests/webtransport/handlers/echo-request-headers.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/testing/web-platform/tests/webtransport/handlers/echo-request-headers.py b/testing/web-platform/tests/webtransport/handlers/echo-request-headers.py
new file mode 100644
index 0000000000..122d6f0601
--- /dev/null
+++ b/testing/web-platform/tests/webtransport/handlers/echo-request-headers.py
@@ -0,0 +1,11 @@
+import json
+
+
+def session_established(session):
+ headers = {}
+ for name, value in session.request_headers:
+ headers[name.decode('utf-8')] = value.decode('utf-8')
+
+ stream_id = session.create_unidirectional_stream()
+ data = json.dumps(headers).encode('utf-8')
+ session.send_stream_data(stream_id, data, end_stream=True)