diff options
author | vsevik@chromium.org <vsevik@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-19 19:07:30 +0000 |
---|---|---|
committer | vsevik@chromium.org <vsevik@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-19 19:07:30 +0000 |
commit | 0ff65a4f58cfe0c04af2c225b644f0751d29b661 (patch) | |
tree | df73d9c799c4b998c5b85dda5a2a9b30dbd4bced | |
parent | fd6abfcc19df4aceb9badaba5eecc2022b4b2d2f (diff) | |
download | chromium_src-0ff65a4f58cfe0c04af2c225b644f0751d29b661.zip chromium_src-0ff65a4f58cfe0c04af2c225b644f0751d29b661.tar.gz chromium_src-0ff65a4f58cfe0c04af2c225b644f0751d29b661.tar.bz2 |
Clear devtools headers when url_request is reused for several HTTP requests
BUG=80157
Review URL: http://codereview.chromium.org/7050010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85949 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/debugger/devtools_netlog_observer.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/chrome/browser/debugger/devtools_netlog_observer.cc b/chrome/browser/debugger/devtools_netlog_observer.cc index 5989c1d..e70b044 100644 --- a/chrome/browser/debugger/devtools_netlog_observer.cc +++ b/chrome/browser/debugger/devtools_netlog_observer.cc @@ -113,6 +113,11 @@ void DevToolsNetLogObserver::OnAddURLRequestEntry( static_cast<net::NetLogHttpRequestParameter*>(params); const net::HttpRequestHeaders &request_headers = request_parameter->GetHeaders(); + + // We need to clear headers in case the same url_request is reused for + // several http requests (e.g. see http://crbug.com/80157). + info->request_headers.clear(); + for (net::HttpRequestHeaders::Iterator it(request_headers); it.GetNext();) { info->request_headers.push_back(std::make_pair(it.name(), @@ -129,6 +134,11 @@ void DevToolsNetLogObserver::OnAddURLRequestEntry( info->http_status_code = response_headers.response_code(); info->http_status_text = response_headers.GetStatusText(); std::string name, value; + + // We need to clear headers in case the same url_request is reused for + // several http requests (e.g. see http://crbug.com/80157). + info->response_headers.clear(); + for (void* it = NULL; response_headers.EnumerateHeaderLines(&it, &name, &value); ) { info->response_headers.push_back(std::make_pair(name, value)); |