Skip to content

Commit

Permalink
Use case-insensitive schemes for getDefaultProvider (#2320).
Browse files Browse the repository at this point in the history
  • Loading branch information
ricmoo committed May 14, 2022
1 parent 95708b9 commit 8b62aef
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/providers/src.ts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ function getDefaultProvider(network?: Networkish, options?: any): BaseProvider {
// Handle http and ws (and their secure variants)
const match = network.match(/^(ws|http)s?:/i);
if (match) {
switch (match[1]) {
case "http":
switch (match[1].toLowerCase()) {
case "http": case "https":
return new JsonRpcProvider(network);
case "ws":
case "ws": case "wss":
return new WebSocketProvider(network);
default:
logger.throwArgumentError("unsupported URL scheme", "network", network);
Expand Down

0 comments on commit 8b62aef

Please sign in to comment.