forked from nodejs/undici
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
allow http & https websocket urls (nodejs#2218)
* allow http & https websocket urls * this test no longer throws
- Loading branch information
Showing
202 changed files
with
608 additions
and
333 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
test/wpt/tests/websockets/Close-reason-unpaired-surrogates.any.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
test/wpt/tests/websockets/Create-asciiSep-protocol-string.any.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
test(() => { | ||
const url = new URL ("/", location); | ||
url.protocol = "http"; | ||
const httpURL = url.href; | ||
url.protocol = "https"; | ||
const httpsURL = url.href; | ||
url.protocol = "ws"; | ||
const wsURL = url.href; | ||
url.protocol = "wss"; | ||
const wssURL = url.href; | ||
|
||
let ws = new WebSocket(httpURL); | ||
assert_equals(ws.url, wsURL); | ||
ws.close(); | ||
|
||
ws = new WebSocket(httpsURL); | ||
assert_equals(ws.url, wssURL); | ||
ws.close(); | ||
}, "WebSocket: ensure both HTTP schemes are supported"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,14 @@ | ||
// META: variant= | ||
// META: variant=?wss | ||
// META: variant=?wpt_flags=h2 | ||
|
||
var wsocket; | ||
test(function() { | ||
assert_throws_dom("SYNTAX_ERR", function() { | ||
wsocket = new WebSocket("/echo") | ||
}); | ||
}, "Url is /echo - should throw SYNTAX_ERR"); | ||
|
||
test(function() { | ||
assert_throws_dom("SYNTAX_ERR", function() { | ||
wsocket = new WebSocket("mailto:microsoft@microsoft.com") | ||
}); | ||
}, "Url is a mail address - should throw SYNTAX_ERR"); | ||
|
||
test(function() { | ||
assert_throws_dom("SYNTAX_ERR", function() { | ||
wsocket = new WebSocket("about:blank") | ||
}); | ||
}, "Url is about:blank - should throw SYNTAX_ERR"); | ||
|
||
test(function() { | ||
assert_throws_dom("SYNTAX_ERR", function() { | ||
wsocket = new WebSocket("?test") | ||
}); | ||
}, "Url is ?test - should throw SYNTAX_ERR"); | ||
|
||
test(function() { | ||
assert_throws_dom("SYNTAX_ERR", function() { | ||
wsocket = new WebSocket("#test") | ||
}); | ||
}, "Url is #test - should throw SYNTAX_ERR"); | ||
[ | ||
"ws://foo bar.com/", | ||
"wss://foo bar.com/", | ||
"ftp://"+location.host+"/", | ||
"mailto:example@example.org", | ||
"about:blank", | ||
location.origin + "/#", | ||
location.origin + "/#test", | ||
"#test" | ||
].forEach(input => { | ||
test(() => { | ||
assert_throws_dom("SyntaxError", () => new WebSocket(input)); | ||
}, `new WebSocket("${input}") should throw a "SyntaxError" DOMException`); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,14 @@ | ||
// META: script=constants.sub.js | ||
// META: variant= | ||
// META: variant=?wss | ||
// META: variant=?wpt_flags=h2 | ||
|
||
test(function() { | ||
var wsocket; | ||
assert_throws_dom("SYNTAX_ERR", function() { | ||
wsocket = CreateWebSocketNonAbsolute() | ||
}); | ||
}, "Create WebSocket - Pass a non absolute URL - SYNTAX_ERR is thrown") | ||
[ | ||
"test", | ||
"?", | ||
null, | ||
123, | ||
].forEach(input => { | ||
test(() => { | ||
const url = new URL(input, location); | ||
url.protocol = "ws"; | ||
const ws = new WebSocket(input); | ||
assert_equals(ws.url, url.href); | ||
ws.close(); | ||
}, `Create WebSocket - Pass a non absolute URL: ${input}`); | ||
}); |
Oops, something went wrong.