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

Unified Diff: Source/core/xmlhttprequest/XMLHttpRequest.cpp

Issue 1018903002: Show deprecation warnings for header values in XHR according to RFC 7230 (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 3 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 | « Source/core/frame/UseCounter.cpp ('k') | Source/platform/network/HTTPParsers.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/xmlhttprequest/XMLHttpRequest.cpp
diff --git a/Source/core/xmlhttprequest/XMLHttpRequest.cpp b/Source/core/xmlhttprequest/XMLHttpRequest.cpp
index 4ec6c06ee3273aa78025da1f4d662b3148431ebc..582385923a8717d77b2fde59f94499c20f3c1d7b 100644
--- a/Source/core/xmlhttprequest/XMLHttpRequest.cpp
+++ b/Source/core/xmlhttprequest/XMLHttpRequest.cpp
@@ -1183,6 +1183,10 @@ void XMLHttpRequest::setRequestHeader(const AtomicString& name, const AtomicStri
return;
}
+ // Show deprecation warnings and count occurrences of such deprecated header values.
+ if (!value.isEmpty() && !isValidHTTPFieldContentRFC7230(value))
+ UseCounter::countDeprecation(executionContext(), UseCounter::HeaderValueNotMatchingRFC7230);
+
// No script (privileged or not) can set unsafe headers.
if (FetchUtils::isForbiddenHeaderName(name)) {
logConsoleError(executionContext(), "Refused to set unsafe header \"" + name + "\"");
« no previous file with comments | « Source/core/frame/UseCounter.cpp ('k') | Source/platform/network/HTTPParsers.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698