Skip to content

Commit

Permalink
feat(call): add ":authority" pseudo-header
Browse files Browse the repository at this point in the history
  • Loading branch information
hishamhm committed Nov 5, 2024
1 parent ec7b444 commit 3f6a48f
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/nodes/call.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,6 @@ impl Node for Call {
}
};

let mut headers_vec = payload::to_pwm_headers(*headers);
headers_vec.push((":method", self.config.method.as_str()));
headers_vec.push((":path", call_url.path()));
headers_vec.push((":scheme", call_url.scheme()));

let body_slice = match payload::to_pwm_body(*body) {
Ok(slice) => slice,
Err(e) => return Fail(vec![Some(Payload::Error(e))]),
Expand All @@ -74,6 +69,12 @@ impl Node for Call {
None => host.to_owned(),
};

let mut headers_vec = payload::to_pwm_headers(*headers);
headers_vec.push((":method", self.config.method.as_str()));
headers_vec.push((":path", call_url.path()));
headers_vec.push((":scheme", call_url.scheme()));
headers_vec.push((":authority", &host_port));

let result = ctx.dispatch_http_call(
&host_port,
headers_vec,
Expand All @@ -87,7 +88,10 @@ impl Node for Call {
log::debug!("call: dispatch call id: {:?}", id);
Waiting(id)
}
Err(status) => Fail(vec![Some(Payload::Error(format!("error: {:?}", status)))]),
Err(status) => {
log::debug!("call: dispatch call failed: {:?}", status);
Fail(vec![Some(Payload::Error(format!("error: {:?}", status)))])
}
}
}

Expand Down

0 comments on commit 3f6a48f

Please sign in to comment.