mirror of
https://github.com/servo/servo.git
synced 2025-08-12 00:45:33 +01:00
Update web-platform-tests to revision 7ed49cff4d031720f829c01df837ed7a09ad5c60
This commit is contained in:
parent
33f0040496
commit
62a9bebeef
220 changed files with 8623 additions and 559 deletions
15
tests/wpt/web-platform-tests/cookies/resources/echo-json.py
Normal file
15
tests/wpt/web-platform-tests/cookies/resources/echo-json.py
Normal file
|
@ -0,0 +1,15 @@
|
|||
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
|
Loading…
Add table
Add a link
Reference in a new issue