Skip to content

Commit

Permalink
Redirects to non-HTTP(S) schemes are a network error
Browse files Browse the repository at this point in the history
See whatwg/fetch#309 for context.
  • Loading branch information
annevk committed May 30, 2016
1 parent bda2059 commit e5430a3
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions fetch/api/redirect/redirect-schemes.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!doctype html>
<meta charset="utf-8">
<title>Fetch: handling different schemes in redirects</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id=log></div>
<script>
// All non-HTTP(S) schemes cannot survive redirects
var url = "../resources/redirect.py?location=",
tests = [
fetch(url + "mailto:a@a.com"),
fetch(url + "data:,HI"),
fetch(url + "facetime:a@a.org"),
fetch(url + "about:blank"),
fetch(url + "about:unicorn"),
fetch(url + "blob:djfksfjs")
]
;tests.forEach(function(f) {
promise_test(function(t) {
return promise_rejects(t, new TypeError(), f)
})
})
</script>

0 comments on commit e5430a3

Please sign in to comment.