mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Update web-platform-tests to revision e8bfc205e36ad699601212cd50083870bad9a75d
This commit is contained in:
parent
65dd6d4340
commit
ccdb0a3458
1428 changed files with 118036 additions and 9786 deletions
18
tests/wpt/web-platform-tests/fetch/api/resources/cache.py
Normal file
18
tests/wpt/web-platform-tests/fetch/api/resources/cache.py
Normal file
|
@ -0,0 +1,18 @@
|
|||
ETAG = '"123abc"'
|
||||
CONTENT_TYPE = "text/plain"
|
||||
CONTENT = "lorem ipsum dolor sit amet"
|
||||
|
||||
|
||||
def main(request, response):
|
||||
# let caching kick in if possible (conditional GET)
|
||||
etag = request.headers.get("If-None-Match", None)
|
||||
if etag == ETAG:
|
||||
response.headers.set("X-HTTP-STATUS", 304)
|
||||
response.status = (304, "Not Modified")
|
||||
return ""
|
||||
|
||||
# cache miss, so respond with the actual content
|
||||
response.status = (200, "OK")
|
||||
response.headers.set("ETag", ETAG)
|
||||
response.headers.set("Content-Type", CONTENT_TYPE)
|
||||
return CONTENT
|
Loading…
Add table
Add a link
Reference in a new issue