Skip to content

Commit

Permalink
Allow 'self.alt' host for self-requests
Browse files Browse the repository at this point in the history
  • Loading branch information
itowlson committed Feb 17, 2025
1 parent 24b8f0a commit f6a3786
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion crates/factor-outbound-http/src/wasi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,12 @@ async fn send_request_impl(
let host = request.uri().host().unwrap_or_default();
let tls_client_config = component_tls_configs.get_client_config(host).clone();

if request.uri().authority().is_some() {
let is_self_request = request
.uri()
.authority()
.is_some_and(|a| a.host() == "self.alt");

if request.uri().authority().is_some() && !is_self_request {
// Absolute URI
let is_allowed = outbound_allowed_hosts
.check_url(&request.uri().to_string(), "https")
Expand Down
2 changes: 1 addition & 1 deletion crates/factor-outbound-networking/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ impl HostConfig {
return Ok(Self::Any);
}

if host == "self" {
if host == "self" || host == "self.alt" {
return Ok(Self::ToSelf);
}

Expand Down

0 comments on commit f6a3786

Please sign in to comment.