Index: third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/header-value-update/invalid-octets.html |
diff --git a/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/header-value-update/invalid-octets.html b/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/header-value-update/invalid-octets.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..9055d9def5ea4c29440c40442052c7c0bdeb4407 |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/header-value-update/invalid-octets.html |
@@ -0,0 +1,26 @@ |
+<!doctype html> |
+<script src="/js-test-resources/js-test.js"></script> |
+<script> |
+window.jsTestIsAsync = true; |
+description('XMLHttpRequest.setRequestHeader() with control octets ' + |
+ 'rejected by RFC 7230 should show a deprecation message.'); |
+// https://crbug.com/455099 |
+ |
+var xhr = new XMLHttpRequest; |
+xhr.open("GET", "../resources/print-headers.cgi"); |
+ |
+// '\x01' is invalid in RFC 7230 and thus deprecation warning should be shown. |
+xhr.setRequestHeader('test1', 'a\x01b'); |
+ |
+xhr.onload = function() { |
+ // This expectation must be updated once we update header value checks. |
+ shouldNotBe('xhr.responseText.match(/HTTP_TEST1: a\\x01b\\r?\\n/)', |
+ 'null'); |
+ finishJSTest(); |
+}; |
+xhr.onerror = function() { |
+ testFailed(); |
+ finishJSTest(); |
+}; |
+xhr.send(); |
+</script> |