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

Unified Diff: content/child/web_url_request_util.cc

Issue 1839473002: Centralize the setting of Accept headers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase again Created 4 years, 8 months 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: content/child/web_url_request_util.cc
diff --git a/content/child/web_url_request_util.cc b/content/child/web_url_request_util.cc
index 230d3d09cfae560d4e7cc260e6e46ecc8303ccaa..bae840b502e4a23a3e93e3544545be34cea6f804 100644
--- a/content/child/web_url_request_util.cc
+++ b/content/child/web_url_request_util.cc
@@ -34,7 +34,7 @@ const char kThrottledErrorDescription[] =
class HeaderFlattener : public blink::WebHTTPHeaderVisitor {
public:
- HeaderFlattener() : has_accept_header_(false) {}
+ HeaderFlattener() {}
void visitHeader(const WebString& name, const WebString& value) override {
// Headers are latin1.
@@ -46,29 +46,17 @@ class HeaderFlattener : public blink::WebHTTPHeaderVisitor {
if (base::LowerCaseEqualsASCII(name_latin1, "referer"))
return;
- if (base::LowerCaseEqualsASCII(name_latin1, "accept"))
- has_accept_header_ = true;
-
if (!buffer_.empty())
buffer_.append("\r\n");
buffer_.append(name_latin1 + ": " + value_latin1);
}
const std::string& GetBuffer() {
- // In some cases, WebKit doesn't add an Accept header, but not having the
- // header confuses some web servers. See bug 808613.
- if (!has_accept_header_) {
- if (!buffer_.empty())
- buffer_.append("\r\n");
- buffer_.append("Accept: */*");
- has_accept_header_ = true;
- }
return buffer_;
}
private:
std::string buffer_;
- bool has_accept_header_;
};
} // namespace
« no previous file with comments | « content/browser/loader/mime_type_resource_handler_unittest.cc ('k') | content/renderer/render_frame_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698