1
0
Fork 0
firefox/testing/web-platform/tests/storage-access-api/resources/set-cookie-header.py
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

12 lines
371 B
Python

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, "")