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

Unified Diff: net/test/embedded_test_server/embedded_test_server.cc

Issue 749793002: Data reduction proxy bypass with test server (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments Created 6 years 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 | « components/test/data/data_reduction_proxy/proxy/noblock.html.mock-http-headers ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/test/embedded_test_server/embedded_test_server.cc
diff --git a/net/test/embedded_test_server/embedded_test_server.cc b/net/test/embedded_test_server/embedded_test_server.cc
index 97b5d84509c5f2324872ce69c3bfedf9459c582e..ac7d3bc14ac74f56b31f3ab83f5c7511f8cf6fb9 100644
--- a/net/test/embedded_test_server/embedded_test_server.cc
+++ b/net/test/embedded_test_server/embedded_test_server.cc
@@ -49,8 +49,15 @@ scoped_ptr<HttpResponse> HandleFileRequest(
// This is a test-only server. Ignore I/O thread restrictions.
base::ThreadRestrictions::ScopedAllowIO allow_io;
+ std::string relative_url(request.relative_url);
+ // A proxy request will have an absolute path. Simulate the proxy by stripping
+ // the scheme, host, and port.
+ GURL relative_gurl(relative_url);
+ if (relative_gurl.is_valid())
+ relative_url = relative_gurl.PathForRequest();
+
// Trim the first byte ('/').
- std::string request_path(request.relative_url.substr(1));
+ std::string request_path = relative_url.substr(1);
// Remove the query string if present.
size_t query_pos = request_path.find('?');
« no previous file with comments | « components/test/data/data_reduction_proxy/proxy/noblock.html.mock-http-headers ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698