diff --git a/cli/flags.rs b/cli/flags.rs index ea800b5090b597..bd84966cd29bac 100644 --- a/cli/flags.rs +++ b/cli/flags.rs @@ -1521,8 +1521,8 @@ fn location_arg_parse( Url::parse(href) .map_err(|e| e.to_string()) .and_then(|url| { - if !["http", "https", "file"].contains(&url.scheme()) { - Err("Expected protocol \"http\", \"https\" or \"file\"".to_string()) + if !["http", "https"].contains(&url.scheme()) { + Err("Expected protocol \"http\" or \"https\"".to_string()) } else { Ok(url) } diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs index 24f43c3f66d060..ae4b42eae867cc 100644 --- a/cli/tests/integration_tests.rs +++ b/cli/tests/integration_tests.rs @@ -2308,11 +2308,7 @@ fn workers() { .arg("test") .arg("--reload") .arg("--location") - .arg( - url::Url::from_directory_path(util::tests_path()) - .unwrap() - .as_str(), - ) + .arg("http://127.0.0.1:4545/cli/tests/") .arg("--allow-net") .arg("--allow-read") .arg("--unstable") diff --git a/cli/tests/workers_test.ts b/cli/tests/workers_test.ts index 2aebf85b0a32d8..d824933d15fc26 100644 --- a/cli/tests/workers_test.ts +++ b/cli/tests/workers_test.ts @@ -401,7 +401,7 @@ Deno.test({ fn: async function (): Promise { // TODO(nayeemrmn): Add `Location` and `location` to `dlint`'s globals. // deno-lint-ignore no-undef - assertEquals(location.href, new URL(".", import.meta.url).href); + assertEquals(location.href, "http://127.0.0.1:4545/cli/tests/"); const promise = deferred(); const w = new Worker( "./subdir/test_worker.ts", diff --git a/docs/runtime/location_api.md b/docs/runtime/location_api.md index ac040af6e92c55..6e73418285c449 100644 --- a/docs/runtime/location_api.md +++ b/docs/runtime/location_api.md @@ -8,7 +8,7 @@ global from the web. Please read on. There is no "web page" whose URL we can use for a location in a Deno process. We instead allow users to emulate a document location by specifying one on the CLI -using the `--location` flag. It can be a `http`, `https` or `file` URL. +using the `--location` flag. It can be a `http` or `https` URL. ```ts // deno run --location https://example.com/path main.ts