summaryrefslogtreecommitdiff
path: root/runtime/permissions/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/permissions/mod.rs')
-rw-r--r--runtime/permissions/mod.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/runtime/permissions/mod.rs b/runtime/permissions/mod.rs
index f1d0362ca..e3ddd8cf4 100644
--- a/runtime/permissions/mod.rs
+++ b/runtime/permissions/mod.rs
@@ -18,6 +18,7 @@ use deno_core::ModuleSpecifier;
use deno_core::OpState;
use log;
use once_cell::sync::Lazy;
+use std::borrow::Cow;
use std::collections::HashSet;
use std::fmt;
use std::hash::Hash;
@@ -872,8 +873,8 @@ impl UnaryPermission<NetDescriptor> {
.ok_or_else(|| uri_error("Missing host"))?
.to_string();
let display_host = match url.port() {
- None => hostname.clone(),
- Some(port) => format!("{hostname}:{port}"),
+ None => Cow::Borrowed(&hostname),
+ Some(port) => Cow::Owned(format!("{hostname}:{port}")),
};
let host = &(&hostname, url.port_or_known_default());
let (result, prompted, is_allow_all) = self.query(Some(host)).check(