Skip to content
This repository has been archived by the owner on Feb 22, 2024. It is now read-only.

Check origin instead of host #95

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix: change host_str to origin
booklearner authored May 24, 2022
commit c83fff0cbbe5aa287637c9885fd518276415f07b
2 changes: 1 addition & 1 deletion crates/wasi-experimental-http-wasmtime/src/lib.rs
Original file line number Diff line number Diff line change
@@ -615,7 +615,7 @@ fn string_from_memory(
fn is_allowed(url: &str, allowed_hosts: Option<&[String]>) -> Result<bool, HttpError> {
let url_host = Url::parse(url)
.map_err(|_| HttpError::InvalidUrl)?
.host_str()
.origin()
.ok_or(HttpError::InvalidUrl)?
.to_owned();
match allowed_hosts {