mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-23 08:57:34 +09:00
import FIREFOX_52_6_0esr_RELEASE from mozilla-esr52 hg repo
This commit is contained in:
commit
dcd9973243
150858 changed files with 23884658 additions and 0 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