diff options
author | Thiago Veronezi <thiago@veronezi.org> | 2020-04-26 11:04:02 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-26 11:04:02 -0400 |
commit | fe6a6704541563bcc3b7cff03359356bb88a560c (patch) | |
tree | c3d4bf58cad90ab19658f8de0c69c0fad5d99346 | |
parent | 62150dd32860a1eb9e7b7ab87f97f8b9cb9a1334 (diff) |
the scheme bits of an uri is case-insensitive; https://tools.ietf.org/html/rfc3986#section-3.1 (#4909)
-rw-r--r-- | cli/installer.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/cli/installer.rs b/cli/installer.rs index 9abc8cd31..472f9a3eb 100644 --- a/cli/installer.rs +++ b/cli/installer.rs @@ -24,7 +24,8 @@ lazy_static! { } pub fn is_remote_url(module_url: &str) -> bool { - module_url.starts_with("http://") || module_url.starts_with("https://") + let lower = module_url.to_lowercase(); + lower.starts_with("http://") || lower.starts_with("https://") } fn validate_exec_name(exec_name: &str) -> Result<(), Error> { @@ -222,6 +223,8 @@ mod tests { fn test_is_remote_url() { assert!(is_remote_url("https://deno.land/std/http/file_server.ts")); assert!(is_remote_url("http://deno.land/std/http/file_server.ts")); + assert!(is_remote_url("HTTP://deno.land/std/http/file_server.ts")); + assert!(is_remote_url("HTTp://deno.land/std/http/file_server.ts")); assert!(!is_remote_url("file:///dev/deno_std/http/file_server.ts")); assert!(!is_remote_url("./dev/deno_std/http/file_server.ts")); } |