mirror of
https://github.com/servo/servo.git
synced 2025-08-11 00:15:32 +01:00
Preserve UserAgent header on redirect.
This commit is contained in:
parent
c8c7bd900d
commit
9a87f830fc
4 changed files with 44 additions and 3 deletions
|
@ -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>
|
Loading…
Add table
Add a link
Reference in a new issue