Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(741)

Side by Side Diff: third_party/WebKit/LayoutTests/external/wpt/fetch/api/resources/cache.py

Issue 2778753002: Import //fetch from Web Platform Tests. (Closed)
Patch Set: Baselines. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 ETAG = '"123abc"'
2 CONTENT_TYPE = "text/plain"
3 CONTENT = "lorem ipsum dolor sit amet"
4
5
6 def main(request, response):
7 # let caching kick in if possible (conditional GET)
8 etag = request.headers.get("If-None-Match", None)
9 if etag == ETAG:
10 response.headers.set("X-HTTP-STATUS", 304)
11 response.status = (304, "Not Modified")
12 return ""
13
14 # cache miss, so respond with the actual content
15 response.status = (200, "OK")
16 response.headers.set("ETag", ETAG)
17 response.headers.set("Content-Type", CONTENT_TYPE)
18 return CONTENT
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698