| <html><head></head><body> |
| |
| <p>Test bug 15530: XMLHttpRequest should not support certain methods</p> |
| <p>Should see a test for the TRACE, TRACK and CONNECT methods :</p> |
| <div id="ans"></div> |
| |
| <script type="text/javascript"> |
| function log(message) |
| { |
| document.getElementById("ans").appendChild(document.createTextNode(message)); |
| } |
| |
| function insertNewLine() |
| { |
| document.getElementById("ans").appendChild(document.createElement("br")); |
| } |
| |
| function testException(method) |
| { |
| try { |
| xhr.open(method, "resources/1251.html", false); |
| log("FAILED"); |
| } catch (e) { |
| log("PASS"); |
| } |
| } |
| |
| if (window.testRunner) |
| testRunner.dumpAsText(); |
| |
| var xhr; |
| |
| if (window.XMLHttpRequest) { |
| xhr = new XMLHttpRequest(); |
| } else { |
| try { |
| xhr = new ActiveXObject("Msxml2.XMLHTTP"); |
| } catch (ex) { |
| xhr = new ActiveXObject("Microsoft.XMLHTTP"); |
| } |
| } |
| |
| log("TRACE : "); |
| testException("TRACE"); |
| insertNewLine(); |
| |
| log("TRACK : "); |
| testException("TRACK"); |
| insertNewLine(); |
| |
| log("CONNECT : "); |
| testException("CONNECT"); |
| insertNewLine(); |
| |
| if (window.testRunner) |
| testRunner.notifyDone(); |
| |
| </script> |
| |
| </body></html> |