mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Update web-platform-tests to revision 8ae1ddbc812733c3a73b103eafad56fb43a2f4b5
This commit is contained in:
parent
d44e9aced2
commit
0e5e5db397
109 changed files with 2053 additions and 708 deletions
|
@ -0,0 +1,25 @@
|
|||
import random, string, datetime
|
||||
|
||||
def 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)
|
||||
count = 0
|
||||
if cookie != None:
|
||||
count = int(cookie.value)
|
||||
if request.GET.first("query", None) != None:
|
||||
headers = [("Count", count)]
|
||||
content = ""
|
||||
return 200, headers, content
|
||||
else:
|
||||
count = count + 1
|
||||
|
||||
unique_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)]
|
||||
content = "report('{}')".format(unique_id)
|
||||
return 200, headers, content
|
Loading…
Add table
Add a link
Reference in a new issue