Sync web-platform-tests up to revision a5b95cb31914507088a4eda16f7674bbc6f3313f
[WebKit-https.git] / LayoutTests / imported / w3c / web-platform-tests / XMLHttpRequest / setrequestheader-header-forbidden.htm
1 <!doctype html>
2 <html>
3   <head>
4     <title>XMLHttpRequest: setRequestHeader() - headers that are forbidden</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
9   </head>
10   <body>
11     <div id="log"></div>
12     <script>
13       test(function() {
14         var client = new XMLHttpRequest()
15         client.open("POST", "resources/inspect-headers.py?filter_value=TEST", false)
16         client.setRequestHeader("Accept-Charset", "TEST")
17         client.setRequestHeader("Accept-Encoding", "TEST")
18         client.setRequestHeader("Connection", "TEST")
19         client.setRequestHeader("Content-Length", "TEST")
20         client.setRequestHeader("Cookie", "TEST")
21         client.setRequestHeader("Cookie2", "TEST")
22         client.setRequestHeader("Date", "TEST")
23         client.setRequestHeader("DNT", "TEST")
24         client.setRequestHeader("Expect", "TEST")
25         client.setRequestHeader("Host", "TEST")
26         client.setRequestHeader("Keep-Alive", "TEST")
27         client.setRequestHeader("Referer", "TEST")
28         client.setRequestHeader("TE", "TEST")
29         client.setRequestHeader("Trailer", "TEST")
30         client.setRequestHeader("Transfer-Encoding", "TEST")
31         client.setRequestHeader("Upgrade", "TEST")
32         client.setRequestHeader("Via", "TEST")
33         client.setRequestHeader("Proxy-", "TEST")
34         client.setRequestHeader("Proxy-LIES", "TEST")
35         client.setRequestHeader("Proxy-Authorization", "TEST")
36         client.setRequestHeader("Sec-", "TEST")
37         client.setRequestHeader("Sec-X", "TEST")
38         client.send(null)
39         assert_equals(client.responseText, "")
40       })
41     </script>
42   </body>
43 </html>