mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Update web-platform-tests to revision d7afcb8708eac08a614d161d5622a48172daf7e3
This commit is contained in:
parent
6f8bb4dd40
commit
edff458e23
791 changed files with 17647 additions and 10322 deletions
|
@ -0,0 +1,28 @@
|
|||
def main(request, response):
|
||||
|
||||
token = request.GET.first("token", None)
|
||||
is_query = request.GET.first("query", None) != None
|
||||
with request.server.stash.lock:
|
||||
value = request.server.stash.take(token)
|
||||
count = 0
|
||||
if value != None:
|
||||
count = int(value)
|
||||
if is_query:
|
||||
if count < 2:
|
||||
request.server.stash.put(token, count)
|
||||
else:
|
||||
count = count + 1
|
||||
request.server.stash.put(token, count)
|
||||
if is_query:
|
||||
headers = [("Count", count)]
|
||||
content = ""
|
||||
return 200, headers, content
|
||||
else:
|
||||
content = "body { background: rgb(0, 128, 0); }"
|
||||
if count > 1:
|
||||
content = "body { background: rgb(255, 0, 0); }"
|
||||
|
||||
headers = [("Content-Type", "text/css"),
|
||||
("Cache-Control", "private, max-age=0, stale-while-revalidate=60")]
|
||||
|
||||
return 200, headers, content
|
Loading…
Add table
Add a link
Reference in a new issue