Index: net/url_request/url_request_http_job.cc |
=================================================================== |
--- net/url_request/url_request_http_job.cc (revision 26480) |
+++ net/url_request/url_request_http_job.cc (working copy) |
@@ -643,11 +643,19 @@ |
if (context) { |
if (context->AllowSendingCookies(request_)) |
request_info_.extra_headers += AssembleRequestCookies(); |
- if (!context->accept_language().empty()) |
- request_info_.extra_headers += "Accept-Language: " + |
+ |
+ // Only add default Accept-Language and Accept-Charset if the request |
+ // didn't have them specifically specified. |
+ static const std::string kAcceptLanguage = "Accept-Language"; |
eroman
2009/09/22 01:02:45
Can you make this a const char* instead?
|
+ if (!context->accept_language().empty() && |
+ !net::HttpUtil::HasHeader(request_info_.extra_headers, kAcceptLanguage.c_str())) |
eroman
2009/09/22 01:02:45
break lines at 80 characters.
|
+ request_info_.extra_headers += kAcceptLanguage + ": " + |
context->accept_language() + "\r\n"; |
- if (!context->accept_charset().empty()) |
- request_info_.extra_headers += "Accept-Charset: " + |
+ |
+ static const std::string kAcceptCharset = "Accept-Charset"; |
eroman
2009/09/22 01:02:45
Please only use static const char*.
|
+ if (!context->accept_charset().empty() && |
+ !net::HttpUtil::HasHeader(request_info_.extra_headers, kAcceptCharset.c_str())) |
eroman
2009/09/22 01:02:45
break lines at 80 characters.
|
+ request_info_.extra_headers += kAcceptCharset + ": " + |
eroman
2009/09/22 01:02:45
Since this is the same as for accept-language, can
|
context->accept_charset() + "\r\n"; |
} |
} |