summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/cookies/resources/list.py
blob: 4cb6639659abb611a5f3245f4e437f2544664b24 (plain)
1
2
3
4
5
6
7
8
9
10
import json
from cookies.resources import helpers

from wptserve.utils import isomorphic_decode

def main(request, response):
    headers = helpers.setNoCacheAndCORSHeaders(request, response)
    cookies = helpers.readCookies(request)
    decoded_cookies = {isomorphic_decode(key): isomorphic_decode(val) for key, val in cookies.items()}
    return headers, json.dumps(decoded_cookies)