summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/storage-access-api/resources/get_cookies.py
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/storage-access-api/resources/get_cookies.py')
-rw-r--r--testing/web-platform/tests/storage-access-api/resources/get_cookies.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/testing/web-platform/tests/storage-access-api/resources/get_cookies.py b/testing/web-platform/tests/storage-access-api/resources/get_cookies.py
new file mode 100644
index 0000000000..07e8c2dae3
--- /dev/null
+++ b/testing/web-platform/tests/storage-access-api/resources/get_cookies.py
@@ -0,0 +1,10 @@
+import json
+from cookies.resources.helpers import makeCookieHeader, readCookies, setNoCacheAndCORSHeaders
+
+from wptserve.utils import isomorphic_decode
+
+def main(request, response):
+ headers = setNoCacheAndCORSHeaders(request, response)
+ cookies = readCookies(request)
+ decoded_cookies = {isomorphic_decode(key): isomorphic_decode(val) for key, val in cookies.items()}
+ return headers, json.dumps(decoded_cookies) \ No newline at end of file