Skip to content

Commit 12871e9

Browse files
committed
Allow host for self-requests
1 parent 24b8f0a commit 12871e9

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

crates/factor-outbound-http/src/wasi.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,12 @@ async fn send_request_impl(
152152
let host = request.uri().host().unwrap_or_default();
153153
let tls_client_config = component_tls_configs.get_client_config(host).clone();
154154

155-
if request.uri().authority().is_some() {
155+
let is_self_request = request
156+
.uri()
157+
.authority()
158+
.is_some_and(|a| a.host() == "self.alt");
159+
160+
if request.uri().authority().is_some() && !is_self_request {
156161
// Absolute URI
157162
let is_allowed = outbound_allowed_hosts
158163
.check_url(&request.uri().to_string(), "https")

crates/factor-outbound-networking/src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ impl HostConfig {
200200
return Ok(Self::Any);
201201
}
202202

203-
if host == "self" {
203+
if host == "self" || host == "self.alt" {
204204
return Ok(Self::ToSelf);
205205
}
206206

0 commit comments

Comments
 (0)