Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redirects to non-HTTP(S) schemes are a network error #3095

Merged
merged 3 commits into from
May 30, 2016
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The indentation in this file is super funky. Please add a newline after the ;, as well?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, removed the tabs. Leading with ";" where needed is sort of my preferred style, but I guess I can change it if you want.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't say I've ever come across it before, and it feels like it sticks out among the prevailing style in the rest of the tests.

})
})
</script>