| <p>Test that custom headers are not sent with OPTIONS preflight request.</p> |
| <script> |
| if (window.testRunner) |
| testRunner.dumpAsText(); |
| |
| function resetStatus() |
| { |
| var req = new XMLHttpRequest; |
| req.open("GET", "/resources/reset-temp-file.py?filename=access-control-preflight-headers-sync-status", false); |
| req.send(); |
| } |
| |
| function sendRequest() |
| { |
| try { |
| var req = new XMLHttpRequest; |
| req.open("GET", "http://localhost:8000/xmlhttprequest/resources/no-custom-header.py?filename=access-control-preflight-headers-sync-status", false); |
| req.setRequestHeader("X-Custom-Header", "foobar"); |
| req.send(); |
| document.write("<xmp>" + req.responseText + "</xmp>"); |
| } catch (ex) { |
| document.write("<xmp>" + ex + "</xmp>"); |
| } |
| } |
| |
| resetStatus(); |
| sendRequest(); |
| </script> |