Skip to content

Commit

Permalink
format.
Browse files Browse the repository at this point in the history
  • Loading branch information
Joinhack committed Jan 21, 2025
1 parent f06f6d2 commit 7f519e5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
2 changes: 0 additions & 2 deletions bls-runtime/src/cli_clap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,6 @@ pub struct PermissionFlags {
#[clap(long = "deny-net", id="deny-net", num_args=(0..) , value_name = "URL[,]", help = DENY_NET_HELP, value_parser = parser_allow)]
pub deny_net: Option<PermissionGrant>,



#[clap(long = "allow-all", id = "allow-all", help = "Allow all permissions.")]
pub allow_all: bool,
}
Expand Down
5 changes: 2 additions & 3 deletions crates/blockless-drivers/src/wasi/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,8 @@ impl blockless_http::BlocklessHttp for WasiCtx {
HttpErrorKind::Utf8Error
})?
.unwrap();

let url_ = Url::from_str(url)
.map_err(|_| HttpErrorKind::InvalidUrl)?;

let url_ = Url::from_str(url).map_err(|_| HttpErrorKind::InvalidUrl)?;
if !self.check_url_permissions(&url_, "http_req") {
error!("Permission Deny");
return Err(HttpErrorKind::PermissionDeny);
Expand Down
2 changes: 1 addition & 1 deletion crates/wasi-common/src/ctx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ impl WasiCtx {
.and_then(|l| l.fix_stdin_ref().map(String::from))
}

pub fn check_url_permissions(&self, host: &Url, api_name: &str) -> bool {
pub fn check_url_permissions(&self, host: &Url, api_name: &str) -> bool {
match self.perms_container.check_net_url(host, api_name) {
Ok(_) => true,
Err(_) => false,
Expand Down

0 comments on commit 7f519e5

Please sign in to comment.