| <html> |
| <body> |
| <p>The "Origin" header must be sent with a "non-simple" cross-origin resource sharing request that uses the GET method.</p> |
| <pre id="console"></pre> |
| <script> |
| if (window.testRunner) { |
| testRunner.dumpAsText(); |
| testRunner.waitUntilDone(); |
| } |
| |
| function log(message) |
| { |
| document.getElementById('console').appendChild(document.createTextNode(message + '\n')); |
| } |
| |
| |
| function test() |
| { |
| var xhr = new XMLHttpRequest(); |
| xhr.open("GET", "http://localhost:8000/xmlhttprequest/resources/cross-origin-preflight-get.php", true); |
| // Make this a "non-simple" cross-origin request by adding a custom header. |
| xhr.setRequestHeader("X-Proprietary-Header", "foo"); |
| xhr.onerror = function() { log("onerror") } |
| xhr.onload = function() { |
| log(xhr.responseText); |
| if (window.testRunner) |
| testRunner.notifyDone(); |
| } |
| xhr.send(null); |
| } |
| |
| test(); |
| </script> |
| </body> |
| </html> |