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

Unified Diff: net/http/http_request_headers.cc

Issue 6065008: Do not override User-Agent header added by WebCore (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 10 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
Index: net/http/http_request_headers.cc
diff --git a/net/http/http_request_headers.cc b/net/http/http_request_headers.cc
index fc2ebcd1defbbd75de931abfe890144923e6f40a..93ead0104826df2024ab2f635f2a60d12dbea408 100644
--- a/net/http/http_request_headers.cc
+++ b/net/http/http_request_headers.cc
@@ -76,6 +76,13 @@ void HttpRequestHeaders::Clear() {
headers_.clear();
}
+void HttpRequestHeaders::SetHeaderIfMissing(const base::StringPiece& key,
+ const base::StringPiece& value) {
+ HeaderVector::iterator it = FindHeader(key);
willchan no longer on Chromium 2010/12/24 20:38:21 It's probably better just to replace these two lin
+ if (it == headers_.end())
+ headers_.push_back(HeaderKeyValuePair(key.as_string(), value.as_string()));
+}
+
void HttpRequestHeaders::SetHeader(const base::StringPiece& key,
const base::StringPiece& value) {
HeaderVector::iterator it = FindHeader(key);

Powered by Google App Engine
This is Rietveld 408576698