Revision 65e0628ee53f311f25f50990f4e7b35ba67b06a0 authored by Henrik Skupin on 28 April 2018, 19:36:03 UTC, committed by moz-wptsync-bot on 28 April 2018, 19:48:02 UTC
bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1457089 gecko-commit: 9d124f189e612ef45f466456934ccc1b1a4ff824 gecko-integration-branch: central gecko-reviewers: jgraham
1 parent 0027df2
preserve-ua-header-on-redirect.htm
<!doctype html>
<html>
<head>
<title>XMLHttpRequest: User-Agent header is preserved on redirect</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<div id="log"></div>
<script>
var test = async_test()
test.step(function() {
var client = new XMLHttpRequest()
client.onreadystatechange = function() {
test.step(function() {
if(client.readyState == 4) {
assert_equals(client.responseText, 'User-Agent: '+navigator.userAgent+'\n')
test.done()
}
})
}
client.open("POST", "resources/redirect.py?location="+encodeURIComponent("inspect-headers.py?filter_name=user-agent"))
client.send(null)
})
var test2 = async_test()
test2.step(function() {
var client = new XMLHttpRequest()
client.onreadystatechange = function() {
test2.step(function() {
if(client.readyState == 4) {
assert_equals(client.responseText, 'User-Agent: TEST\n')
test2.done()
}
})
}
client.open("POST", "resources/redirect.py?location="+encodeURIComponent("inspect-headers.py?filter_name=user-agent"))
client.setRequestHeader("User-Agent", "TEST")
client.send(null)
})
</script>
</body>
</html>
Computing file changes ...