mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Update web-platform-tests to revision 5934bd3aca20a07917ad46fe7cebe10c68d5e497
This commit is contained in:
parent
e41f1662dc
commit
64b58d76c6
67 changed files with 656 additions and 278 deletions
|
@ -1,18 +1,18 @@
|
|||
ETAG = '"123abc"'
|
||||
CONTENT_TYPE = "text/plain"
|
||||
CONTENT = "lorem ipsum dolor sit amet"
|
||||
ETAG = b'"123abc"'
|
||||
CONTENT_TYPE = b"text/plain"
|
||||
CONTENT = b"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)
|
||||
etag = request.headers.get(b"If-None-Match", None)
|
||||
if etag == ETAG:
|
||||
response.headers.set("X-HTTP-STATUS", 304)
|
||||
response.status = (304, "Not Modified")
|
||||
return ""
|
||||
response.headers.set(b"X-HTTP-STATUS", 304)
|
||||
response.status = (304, b"Not Modified")
|
||||
return b""
|
||||
|
||||
# cache miss, so respond with the actual content
|
||||
response.status = (200, "OK")
|
||||
response.headers.set("ETag", ETAG)
|
||||
response.headers.set("Content-Type", CONTENT_TYPE)
|
||||
response.status = (200, b"OK")
|
||||
response.headers.set(b"ETag", ETAG)
|
||||
response.headers.set(b"Content-Type", CONTENT_TYPE)
|
||||
return CONTENT
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue