mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Update web-platform-tests to revision de9a09ab7f605aed6a4b53ed96427412bab76463
This commit is contained in:
parent
f3f9303fc9
commit
73a776843f
225 changed files with 5750 additions and 2858 deletions
|
@ -4,7 +4,9 @@ import time
|
|||
def main(request, response):
|
||||
index = request.request_path.index("?")
|
||||
args = request.request_path[index+1:].split("&")
|
||||
headersSent = 0
|
||||
headers = []
|
||||
statusSent = False
|
||||
headersSent = False
|
||||
for arg in args:
|
||||
if arg.startswith("ignored"):
|
||||
continue
|
||||
|
@ -13,14 +15,28 @@ def main(request, response):
|
|||
elif arg.startswith("redirect:"):
|
||||
return (302, "WEBPERF MARKETING"), [("Location", urllib.unquote(arg[9:]))], "TEST"
|
||||
elif arg.startswith("mime:"):
|
||||
response.headers.set("Content-Type", urllib.unquote(arg[5:]))
|
||||
headers.append(("Content-Type", urllib.unquote(arg[5:])))
|
||||
elif arg.startswith("send:"):
|
||||
text = urllib.unquote(arg[5:])
|
||||
if headersSent == 0:
|
||||
response.write_status_headers()
|
||||
headersSent = 1
|
||||
|
||||
if not statusSent:
|
||||
# Default to a 200 status code.
|
||||
response.writer.write_status(200)
|
||||
statusSent = True
|
||||
if not headersSent:
|
||||
for key, value in headers:
|
||||
response.writer.write_header(key, value)
|
||||
response.writer.end_headers()
|
||||
headersSent = True
|
||||
|
||||
response.writer.write_content(text)
|
||||
elif arg.startswith("status:"):
|
||||
code = int(urllib.unquote(arg[7:]))
|
||||
response.writer.write_status(code)
|
||||
statusSent = True
|
||||
elif arg == "flush":
|
||||
response.writer.flush()
|
||||
|
||||
# else:
|
||||
# error " INVALID ARGUMENT %s" % arg
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue