blob: f2abc5c2199cb60d244c7586b1dc2e79b2166332 [file] [log] [blame]
Anne van Kesteren66b54172010-08-11 18:02:171<!doctype html>
2<html>
3 <head>
4 <title>XMLHttpRequest: setRequestHeader() - headers that are allowed</title>
5 <script src="/resources/testharness.js"></script>
Ms2ger6f083e72012-08-05 08:38:146 <script src="/resources/testharnessreport.js"></script>
Hallvord R. M. Steen6bb53052012-11-09 10:47:497 <link rel="help" href="http://dvcs.w3.org/hg/xhr/raw-file/tip/Overview.html#the-setrequestheader()-method" data-tested-assertations="/following::ol/li[6] /following::ol/li[7]" />
Anne van Kesteren66b54172010-08-11 18:02:178 </head>
9 <body>
10 <div id="log"></div>
11 <script>
12 function request(header) {
13 test(function() {
14 var client = new XMLHttpRequest()
15 client.open("POST", "resources/inspect-headers.php?filter_value=t1, t2", false)
16 client.setRequestHeader(header, "t1")
17 client.setRequestHeader(header, "t2")
18 client.send(null)
19 assert_equals(client.responseText, header.toLowerCase() + ",")
20 }, document.title + " (" + header + ")")
21 }
22 request("Authorization")
23 request("Pragma")
Hallvord R. M. Steen6bb53052012-11-09 10:47:4924 request("Content-Transfer-Encoding")
Anne van Kesteren66b54172010-08-11 18:02:1725 request("Content-Type")
26 request("Overwrite")
27 request("If")
28 request("Status-URI")
29 request("X-Pink-Unicorn")
30 </script>
31 </body>
32</html>