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

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, 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: Source/core/xmlhttprequest/XMLHttpRequest.cpp
diff --git a/Source/core/xmlhttprequest/XMLHttpRequest.cpp b/Source/core/xmlhttprequest/XMLHttpRequest.cpp
index 4ec6c06ee3273aa78025da1f4d662b3148431ebc..0380148b6d28e71c216b4f1dc2b62e2f0e12fcae 100644
--- a/Source/core/xmlhttprequest/XMLHttpRequest.cpp
+++ b/Source/core/xmlhttprequest/XMLHttpRequest.cpp
@@ -1178,6 +1178,10 @@ void XMLHttpRequest::setRequestHeader(const AtomicString& name, const AtomicStri
return;
}
+ // Show deprecation warnings and count occurrences of such deprecated header values
+ if (isValidHTTPHeaderValueForFetch(value))
hiroshige 2015/08/27 11:38:08 How about replacing this with "if (!isValidHTTPHea
shiva.jm 2015/09/01 08:26:51 Done.
+ UseCounter::countDeprecation(executionContext(), UseCounter::FetchHeaderValue);
+
if (!isValidHTTPHeaderValue(value)) {
exceptionState.throwDOMException(SyntaxError, "'" + value + "' is not a valid HTTP header field value.");
return;

Powered by Google App Engine
This is Rietveld 408576698