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

Unified Diff: third_party/WebKit/Source/core/loader/FrameFetchContext.cpp

Issue 1783653002: save-data header value gets appended on page refreshes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 9 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: third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
diff --git a/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp b/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
index 5bdfcb105a9e4b151336647a87ae36f5a2458e66..21f219ea0956532ff7441293f5fc8ee42631320c 100644
--- a/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
+++ b/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
@@ -119,8 +119,11 @@ void FrameFetchContext::addAdditionalRequestHeaders(ResourceRequest& request, Fe
if (!request.url().isEmpty() && !request.url().protocolIsInHTTPFamily())
return;
+ if (frame()->loader().loadType() == FrameLoadTypeReload)
+ request.clearHTTPHeaderField("Save-Data");
+
if (frame()->settings() && frame()->settings()->dataSaverEnabled())
- request.addHTTPHeaderField("Save-Data", "on");
+ request.setHTTPHeaderField("Save-Data", "on");
frame()->loader().applyUserAgent(request);
}
« no previous file with comments | « chrome/browser/data_saver/data_saver_browsertest.cc ('k') | third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698