OLD | NEW |
1 <html> | 1 <html> |
2 <body> | 2 <body> |
3 <p>Test for bug 75089: Access-Control-Request-Headers values should be lowercase
.</p> | 3 <p>Test for bug 452391: Header names in Access-Control-Request-Headers must be s
orted.</p> |
4 <script> | 4 <script> |
5 if (window.testRunner) { | 5 if (window.testRunner) { |
6 testRunner.dumpAsText(); | 6 testRunner.dumpAsText(); |
7 testRunner.waitUntilDone(); | 7 testRunner.waitUntilDone(); |
8 } | 8 } |
9 | 9 |
10 function sendRequest() | 10 function sendRequest() |
11 { | 11 { |
12 var xhr = new XMLHttpRequest; | 12 var xhr = new XMLHttpRequest; |
13 xhr.open("GET", "http://localhost:8000/xmlhttprequest/resources/access-contr
ol-preflight-request-header-lowercase.php"); | 13 xhr.open("GET", "http://localhost:8000/xmlhttprequest/resources/access-contr
ol-preflight-request-header-sorted.php"); |
14 xhr.setRequestHeader("X-Custom-Header", "foobar"); | 14 xhr.setRequestHeader("X-Custom-Test", "foobar"); |
| 15 xhr.setRequestHeader("X-Custom-ua", "foobar"); |
| 16 xhr.setRequestHeader("X-Custom-V", "foobar"); |
| 17 xhr.setRequestHeader("X-Custom-s", "foobar"); |
| 18 xhr.setRequestHeader("X-Custom-U", "foobar"); |
15 xhr.onerror = function() { | 19 xhr.onerror = function() { |
16 document.body.appendChild(document.createTextNode("FAIL: onerror called"
)); | 20 document.body.appendChild(document.createTextNode("FAIL: onerror called"
)); |
17 if (window.testRunner) | 21 if (window.testRunner) |
18 testRunner.notifyDone(); | 22 testRunner.notifyDone(); |
19 } | 23 } |
20 | 24 |
21 xhr.onreadystatechange=function() { | 25 xhr.onreadystatechange=function() { |
22 if (xhr.readyState==4) { | 26 if (xhr.readyState==4) { |
23 document.body.appendChild(document.createTextNode(xhr.responseText))
; | 27 document.body.appendChild(document.createTextNode(xhr.responseText))
; |
24 if (window.testRunner) | 28 if (window.testRunner) |
25 testRunner.notifyDone(); | 29 testRunner.notifyDone(); |
26 } | 30 } |
27 } | 31 } |
28 xhr.send(); | 32 xhr.send(); |
29 } | 33 } |
30 sendRequest(); | 34 sendRequest(); |
31 </script> | 35 </script> |
32 </body> | 36 </body> |
33 </html> | 37 </html> |
OLD | NEW |