mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Update web-platform-tests to revision 21461a83c51b72bcff82476c1b79a26a194e7bab
This commit is contained in:
parent
ea206034ad
commit
f96f9a1b78
61 changed files with 1372 additions and 376 deletions
|
@ -1,14 +1,15 @@
|
|||
import random, string, datetime
|
||||
|
||||
def token():
|
||||
def id_token():
|
||||
letters = string.ascii_lowercase
|
||||
return ''.join(random.choice(letters) for i in range(20))
|
||||
|
||||
def main(request, response):
|
||||
cookie = request.cookies.first("Count", None)
|
||||
token = request.GET.first("token", None)
|
||||
value = request.server.stash.take(token)
|
||||
count = 0
|
||||
if cookie != None:
|
||||
count = int(cookie.value)
|
||||
if value != None:
|
||||
count = int(value)
|
||||
if request.GET.first("query", None) != None:
|
||||
headers = [("Count", count)]
|
||||
content = ""
|
||||
|
@ -16,10 +17,10 @@ def main(request, response):
|
|||
else:
|
||||
count = count + 1
|
||||
|
||||
unique_id = token()
|
||||
unique_id = id_token()
|
||||
headers = [("Content-Type", "text/javascript"),
|
||||
("Cache-Control", "private, max-age=0, stale-while-revalidate=10"),
|
||||
("Set-Cookie", "Count={}".format(count)),
|
||||
("Token", unique_id)]
|
||||
("Cache-Control", "private, max-age=0, stale-while-revalidate=60"),
|
||||
("Unique-Id", unique_id)]
|
||||
content = "report('{}')".format(unique_id)
|
||||
request.server.stash.put(token, count)
|
||||
return 200, headers, content
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue