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

Unified Diff: net/tools/testserver/testserver.py

Issue 23496076: WIP - Refactor programmatic downloads Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/public/test/mock_download_manager.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/testserver/testserver.py
diff --git a/net/tools/testserver/testserver.py b/net/tools/testserver/testserver.py
index e0317e8868524bece9b141f20b74a02c3faae673..e7de47367e34fc57997d2802e17b9ee9c3e28010 100755
--- a/net/tools/testserver/testserver.py
+++ b/net/tools/testserver/testserver.py
@@ -1478,6 +1478,8 @@ class TestPageHandler(testserver_base.BasePageHandler):
if not self._ShouldHandleRequest('/rangereset'):
return False
+ # HTTP/1.1 is required for ETag and range support.
+ self.protocol_version = 'HTTP/1.1'
_, _, url_path, _, query, _ = urlparse.urlparse(self.path)
# Defaults
@@ -1558,7 +1560,10 @@ class TestPageHandler(testserver_base.BasePageHandler):
self.send_header('Content-Type', 'application/octet-stream')
self.send_header('Content-Length', last_byte - first_byte + 1)
if send_verifiers:
- self.send_header('Etag', '"XYZZY"')
+ # If fail_precondition is non-zero, then the ETag for each request will be
+ # different.
+ etag = "%s%d" % (token, fail_precondition)
+ self.send_header('ETag', etag)
self.send_header('Last-Modified', 'Tue, 19 Feb 2013 14:32 EST')
self.end_headers()
« no previous file with comments | « content/public/test/mock_download_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698