diff options
author | battre@chromium.org <battre@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-24 11:15:01 +0000 |
---|---|---|
committer | battre@chromium.org <battre@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-24 11:15:01 +0000 |
commit | 97ce1ae59952f2fc30cef5e5f2d02322c4dd056e (patch) | |
tree | 54f369ced9d44414719f34f9d0bb713aae4b2d06 /net/http/http_response_headers.h | |
parent | a0a2d853b2ce026e193c46c16aa323fe0c888325 (diff) | |
download | chromium_src-97ce1ae59952f2fc30cef5e5f2d02322c4dd056e.zip chromium_src-97ce1ae59952f2fc30cef5e5f2d02322c4dd056e.tar.gz chromium_src-97ce1ae59952f2fc30cef5e5f2d02322c4dd056e.tar.bz2 |
Fix removal of headers
HttpResponseHeaders::RemoveHeaderWithValue did not correctly remove headers if the passed value contained a comma. For a header "Foo: bar, baz", RemoveHeaderWithValue("Foo", "bar, baz") would be be a non-op. This CL fixes that. As the web request API is the only consumer of this function, there will be no side effects on other code due to the changed behavior.
BUG=137396
TEST=no
Review URL: https://chromiumcodereview.appspot.com/10809011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148078 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http/http_response_headers.h')
-rw-r--r-- | net/http/http_response_headers.h | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/net/http/http_response_headers.h b/net/http/http_response_headers.h index f6a270a..d2586d2 100644 --- a/net/http/http_response_headers.h +++ b/net/http/http_response_headers.h @@ -65,9 +65,9 @@ class NET_EXPORT HttpResponseHeaders // Removes all instances of a particular header. void RemoveHeader(const std::string& name); - // Removes a particular header. The header name is compared + // Removes a particular header line. The header name is compared // case-insensitively. - void RemoveHeaderWithValue(const std::string& name, const std::string& value); + void RemoveHeaderLine(const std::string& name, const std::string& value); // Adds a particular header. |header| has to be a single header without any // EOL termination, just [<header-name>: <header-values>] @@ -321,16 +321,6 @@ class NET_EXPORT HttpResponseHeaders void MergeWithHeaders(const std::string& raw_headers, const HeaderSet& headers_to_remove); - // Replaces the current headers with the merged version of |raw_headers| and - // the current headers with out the header consisting of - // |header_to_remove_name| and |header_to_remove_value|. Note that - // |header_to_remove_name| is compared case-insensitively. - // Note that the header to remove is removed from the current headers (before - // the merge), not after the merge. - void MergeWithHeadersWithValue(const std::string& raw_headers, - const std::string& header_to_remove_name, - const std::string& header_to_remove_value); - // Adds the values from any 'cache-control: no-cache="foo,bar"' headers. void AddNonCacheableHeaders(HeaderSet* header_names) const; |