mirror of
https://github.com/ManchildProductions/UXP-Fixed.git
synced 2026-06-12 11:49:38 +00:00
16 lines
500 B
Python
16 lines
500 B
Python
import json
|
|
|
|
def main(request, response):
|
|
headers = [("Content-Type", "application/json"),
|
|
("Access-Control-Allow-Credentials", "true")]
|
|
|
|
if "origin" in request.headers:
|
|
headers.append(("Access-Control-Allow-Origin", request.headers["origin"]))
|
|
|
|
values = []
|
|
for key in request.cookies:
|
|
for value in request.cookies.get_list(key):
|
|
values.append("\"%s\": \"%s\"" % (key, value))
|
|
body = "{ %s }" % ",".join(values)
|
|
return headers, body
|