summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/xhr/send-redirect-bogus.htm
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/xhr/send-redirect-bogus.htm')
-rw-r--r--testing/web-platform/tests/xhr/send-redirect-bogus.htm36
1 files changed, 36 insertions, 0 deletions
diff --git a/testing/web-platform/tests/xhr/send-redirect-bogus.htm b/testing/web-platform/tests/xhr/send-redirect-bogus.htm
new file mode 100644
index 0000000000..ad50b56f4a
--- /dev/null
+++ b/testing/web-platform/tests/xhr/send-redirect-bogus.htm
@@ -0,0 +1,36 @@
+<!doctype html>
+<html>
+ <head>
+ <title>XMLHttpRequest: send() - Redirects (bogus Location header)</title>
+ <meta name=timeout content=long>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <link rel="help" href="https://xhr.spec.whatwg.org/#infrastructure-for-the-send()-method" data-tested-assertations="following::dl[1]/dt[2] following::dl[1]/dd[2]/ol/li[1] following::dl[1]/dd[2]/ol/li[3]" />
+ </head>
+ <body>
+ <div id="log"></div>
+ <script>
+ function redirect(code, location) {
+ var test = async_test(document.title + " (" + code + ": " + location + ")");
+ test.step(function() {
+ var client = new XMLHttpRequest()
+ client.onreadystatechange = function() {
+ test.step(function() {
+ if(client.readyState == 4) {
+ assert_equals(client.status, 0)
+ assert_equals(client.statusText, "")
+ test.done()
+ }
+ })
+ }
+ client.open("GET", "resources/redirect.py?location=" + location + "&code=" + code)
+ client.send(null)
+ })
+ }
+ redirect("302", "http://example.not")
+ redirect("302", "mailto:someone@example.org")
+ redirect("303", "http://example.not")
+ redirect("303", "foobar:someone@example.org")
+ </script>
+ </body>
+</html>