mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Update web-platform-tests to revision 58eb04cecbbec2e18531ab440225e38944a9c444
This commit is contained in:
parent
25e8bf69e6
commit
665817d2a6
35333 changed files with 1818077 additions and 16036 deletions
|
@ -3,15 +3,27 @@ def main(request, response):
|
|||
match = request.headers.get("If-None-Match", None)
|
||||
date = request.GET.first("date", "")
|
||||
modified = request.headers.get("If-Modified-Since", None)
|
||||
cors = request.GET.first("cors", None)
|
||||
|
||||
if request.method == "OPTIONS":
|
||||
response.headers.set("Access-Control-Allow-Origin", "*")
|
||||
response.headers.set("Access-Control-Allow-Headers", "IF-NONE-MATCH")
|
||||
return ""
|
||||
|
||||
if tag:
|
||||
response.headers.set("ETag", '"%s"' % tag)
|
||||
elif date:
|
||||
response.headers.set("Last-Modified", date)
|
||||
|
||||
if cors:
|
||||
response.headers.set("Access-Control-Allow-Origin", "*")
|
||||
|
||||
if ((match is not None and match == tag) or
|
||||
(modified is not None and modified == date)):
|
||||
response.status = (304, "SUPERCOOL")
|
||||
return ""
|
||||
else:
|
||||
if not cors:
|
||||
response.headers.set("Access-Control-Allow-Origin", "*")
|
||||
response.headers.set("Content-Type", "text/plain")
|
||||
return "MAYBE NOT"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue