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

Unified Diff: net/url_request/url_request_http_job.cc

Issue 2254693002: Delay generation of User-Agent header to URLRequestHttpJob and accept custom User-Agent from XHR/Fe… Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: a Created 4 years, 4 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: 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 d2a4797bff6a8310d6aede6477d1cf2198a2a28b..8ca8392ee689560eb1d94c1deaa87442cc6ca415 100644
--- a/net/url_request/url_request_http_job.cc
+++ b/net/url_request/url_request_http_job.cc
@@ -387,6 +387,11 @@ void URLRequestHttpJob::Start() {
request_info_.token_binding_referrer = request_->token_binding_referrer();
+ if (request_->has_default_user_agent()) {
+ request_info_.extra_headers.SetHeaderIfMissing(
+ HttpRequestHeaders::kUserAgent, request_->default_user_agent());
mmenke 2016/08/21 14:37:39 I really don't think we need two different wants t
tyoshino (SeeGerritForStatus) 2016/08/23 10:01:47 Right. I'd like to propagate DevTools' User-Agent
mmenke 2016/08/23 14:54:33 Could ServiceWorker just hide the header it passes
tyoshino (SeeGerritForStatus) 2016/08/25 04:11:34 I think embedding everything into the header holde
mmenke 2016/08/25 04:17:01 SGTM. I think it's also worth noting that the beh
+ }
+
request_info_.extra_headers.SetHeaderIfMissing(
HttpRequestHeaders::kUserAgent,
http_user_agent_settings_ ?

Powered by Google App Engine
This is Rietveld 408576698