diff options
Diffstat (limited to 'testing/web-platform/tests/storage-access-api/resources/set-cookie-header.py')
-rw-r--r-- | testing/web-platform/tests/storage-access-api/resources/set-cookie-header.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/testing/web-platform/tests/storage-access-api/resources/set-cookie-header.py b/testing/web-platform/tests/storage-access-api/resources/set-cookie-header.py new file mode 100644 index 0000000000..e937ba2ca4 --- /dev/null +++ b/testing/web-platform/tests/storage-access-api/resources/set-cookie-header.py @@ -0,0 +1,12 @@ +from urllib.parse import unquote +from wptserve.utils import isomorphic_encode + +def main(request, response): + # Cookies may require whitespace (e.g. in the `Expires` attribute), so the + # query string should be decoded. + cookie = unquote(request.url_parts.query) + headers = [] + headers.append((b"Set-Cookie", isomorphic_encode(cookie))) + + return (200, headers, "") + |