OLD | NEW |
1 <p>Test that null values in XHR login/password parameters are treated correctly.
</p> | 1 <p>Test that null values in XHR login/password parameters are treated correctly.
</p> |
2 <p>No auth tokens should be sent with this request.</p> | 2 <p>No auth tokens should be sent with this request.</p> |
3 <pre id='syncResult'> </pre> | 3 <pre id='syncResult'> </pre> |
4 <script> | 4 <script> |
5 if (window.testRunner) | 5 if (window.testRunner) |
6 testRunner.dumpAsText(); | 6 testRunner.dumpAsText(); |
7 | 7 |
8 try { | 8 req = new XMLHttpRequest; |
9 req = new XMLHttpRequest; | 9 req.open('POST', '<?php echo 'http://foo:bar@' . $_SERVER['HTTP_HOST'] . '/xmlht
tprequest/resources/echo-auth.php' ?>', false, null, null); |
10 req.open('POST', '<?php echo 'http://foo:bar@' . $_SERVER['HTTP_HOST'] . '/xml
httprequest/resources/echo-auth.php' ?>', false, null, null); | 10 req.send(); |
11 req.send(); | 11 document.getElementById('syncResult').firstChild.nodeValue = req.responseText; |
12 console.log("Fail: credentialed URLs should throw."); | |
13 } catch (e) { | |
14 console.log("Pass: credentialed URL threw."); | |
15 } | |
16 </script> | 12 </script> |
OLD | NEW |