Sync web-platform-tests up to revision a5b95cb31914507088a4eda16f7674bbc6f3313f
[WebKit-https.git] / LayoutTests / imported / w3c / web-platform-tests / XMLHttpRequest / setrequestheader-allow-whitespace-in-value.htm
1 <!DOCTYPE html>
2 <html>
3   <head>
4     <title>XMLHttpRequest: setRequestHeader() - header value with whitespace</title>
5     <script src="/resources/testharness.js"></script>
6     <script src="/resources/testharnessreport.js"></script>
7     <link rel="help" href="https://xhr.spec.whatwg.org/#the-setrequestheader()-method">
8   </head>
9   <body>
10     <div id="log"></div>
11     <script>
12       function request(value) {
13         test(function() {
14           var client = new XMLHttpRequest()
15           client.open("POST", "resources/inspect-headers.py?filter_name=X-Empty", false)
16           client.setRequestHeader('X-Empty', value)
17           client.send(null)
18           assert_equals(client.responseText, 'X-Empty: ' + value.trim() + '\n' )
19         }, document.title + " (" + value + ")")
20       }
21       request(" ")
22       request(" t")
23       request("t ")
24       request(" t ")
25     </script>
26   </body>
27 </html>