Skip to content

Commit 8b62aef

Browse files
committed
Use case-insensitive schemes for getDefaultProvider (#2320).
1 parent 95708b9 commit 8b62aef

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/providers/src.ts/index.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ function getDefaultProvider(network?: Networkish, options?: any): BaseProvider {
5454
// Handle http and ws (and their secure variants)
5555
const match = network.match(/^(ws|http)s?:/i);
5656
if (match) {
57-
switch (match[1]) {
58-
case "http":
57+
switch (match[1].toLowerCase()) {
58+
case "http": case "https":
5959
return new JsonRpcProvider(network);
60-
case "ws":
60+
case "ws": case "wss":
6161
return new WebSocketProvider(network);
6262
default:
6363
logger.throwArgumentError("unsupported URL scheme", "network", network);

0 commit comments

Comments
 (0)