Chromium Code Reviews| 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..b3355783a2c235171acd75695d4c0b173ec4de02 100644 |
| --- a/net/test/embedded_test_server/embedded_test_server.cc |
| +++ b/net/test/embedded_test_server/embedded_test_server.cc |
| @@ -49,8 +49,16 @@ scoped_ptr<HttpResponse> HandleFileRequest( |
| // This is a test-only server. Ignore I/O thread restrictions. |
| base::ThreadRestrictions::ScopedAllowIO allow_io; |
| + std::string request_path(request.relative_url); |
| + // A proxy will have an absolute path. Simulate the proxy by stripping the |
| + // scheme, host, and port. |
| + if (request_path.find("http://127.0.0.1") == 0) { |
|
mmenke
2014/12/04 18:17:08
Can you just create a GURL from the path, and call
bengr
2014/12/05 23:13:32
Done.
|
| + GURL request_url(request_path); |
| + request_path = request_url.path() + |
| + (request_url.query().empty() ? "" : "?" + request_url.query()); |
|
mmenke
2014/12/04 18:17:09
request_url.PathForRequest()?
bengr
2014/12/05 23:13:32
Done. (Somehow I missed that method.)
|
| + } |
| // Trim the first byte ('/'). |
| - std::string request_path(request.relative_url.substr(1)); |
| + request_path = request_path.substr(1); |
|
mmenke
2014/12/04 18:17:09
Not a big fan of "This is the request_path, no, th
bengr
2014/12/05 23:13:32
Done.
|
| // Remove the query string if present. |
| size_t query_pos = request_path.find('?'); |