blob: 0fc688a36be981c61a94d77e1bd5961eda1c432f [file] [log] [blame]
<p>Test that Authorization header can be set via setRequestHeader.</p>
<script>
if (window.testRunner)
testRunner.dumpAsText();
try {
var req = new XMLHttpRequest;
req.open("GET", "resources/basic-auth/basic-auth.py?uid=Authorization-Header", false);
req.setRequestHeader("Authorization", "Basic QXV0aG9yaXphdGlvbi1IZWFkZXI6QXV0aG9yaXphdGlvbi1IZWFkZXI=");
req.send(null);
document.write(req.responseText.match(/Authorization\-Header/) ? "PASS" : ("FAIL. Unexpected response: " + req.responseText));
} catch (ex) {
document.write("FAIL. Exception: " + ex);
}
</script>