From c83fff0cbbe5aa287637c9885fd518276415f07b Mon Sep 17 00:00:00 2001 From: booklearner Date: Mon, 23 May 2022 22:08:20 -0400 Subject: [PATCH] fix: change `host_str` to `origin` --- crates/wasi-experimental-http-wasmtime/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/wasi-experimental-http-wasmtime/src/lib.rs b/crates/wasi-experimental-http-wasmtime/src/lib.rs index 7cbd0b1..27ea413 100644 --- a/crates/wasi-experimental-http-wasmtime/src/lib.rs +++ b/crates/wasi-experimental-http-wasmtime/src/lib.rs @@ -615,7 +615,7 @@ fn string_from_memory( fn is_allowed(url: &str, allowed_hosts: Option<&[String]>) -> Result { let url_host = Url::parse(url) .map_err(|_| HttpError::InvalidUrl)? - .host_str() + .origin() .ok_or(HttpError::InvalidUrl)? .to_owned(); match allowed_hosts {