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

Unified Diff: net/url_request/url_request_http_job.cc

Issue 2125253002: Advertise brotli for localhost requests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request_http_job.cc
diff --git a/net/url_request/url_request_http_job.cc b/net/url_request/url_request_http_job.cc
index 7855fe25cac0af1be6f9e46ac04752f4c1274ae7..a398986da32fc39d59e47055b80fc5888f49b33a 100644
--- a/net/url_request/url_request_http_job.cc
+++ b/net/url_request/url_request_http_job.cc
@@ -716,8 +716,12 @@ void URLRequestHttpJob::AddExtraHeaders() {
// Advertise "br" encoding only if transferred data is opaque to proxy.
bool advertise_brotli = false;
- if (request()->context()->enable_brotli())
- advertise_brotli = request()->url().SchemeIsCryptographic();
+ if (request()->context()->enable_brotli()) {
+ if (request()->url().SchemeIsCryptographic() ||
+ IsLocalhost(request()->url().HostNoBrackets())) {
+ advertise_brotli = true;
+ }
+ }
// Supply Accept-Encoding headers first so that it is more likely that they
// will be in the first transmitted packet. This can sometimes make it
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698