mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Update web-platform-tests to revision 0d318188757a9c996e20b82db201fd04de5aa255
This commit is contained in:
parent
b2a5225831
commit
1a81b18b9f
12321 changed files with 544385 additions and 6 deletions
|
@ -0,0 +1,24 @@
|
|||
def main(request, response):
|
||||
name = "recon_fail_" + request.GET.first("id")
|
||||
|
||||
headers = [("Content-Type", "text/event-stream")]
|
||||
cookie = request.cookies.first(name, None)
|
||||
state = cookie.value if cookie is not None else None
|
||||
|
||||
if state == 'opened':
|
||||
status = (200, "RECONNECT")
|
||||
response.set_cookie(name, "reconnected");
|
||||
body = "data: reconnected\n\n";
|
||||
|
||||
elif state == 'reconnected':
|
||||
status = (204, "NO CONTENT (CLOSE)")
|
||||
response.delete_cookie(name);
|
||||
body = "data: closed\n\n" # Will never get through
|
||||
|
||||
else:
|
||||
status = (200, "OPEN");
|
||||
response.set_cookie(name, "opened");
|
||||
body = "retry: 2\ndata: opened\n\n";
|
||||
|
||||
return status, headers, body
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue