Preserve UserAgent header on redirect.

This commit is contained in:
Eduard Burtescu 2015-06-12 21:05:33 +03:00
parent c8c7bd900d
commit 9a87f830fc
4 changed files with 44 additions and 3 deletions

View file

@ -0,0 +1,28 @@
<!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 ua = "Servo/wptrunner";
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,")
test.done()
}
})
}
client.open("POST", "resources/redirect.py?location="+encodeURIComponent("inspect-headers.py?filter_value="+ua))
client.send(null)
})
</script>
</body>
</html>