Skip to content

Commit bb71d6d

Browse files
authored
Merge pull request #104 from dfinity/rjb/fix-inject-host-header
fix: inject host header if HTTP2 is used
2 parents b7b13cf + c389dfb commit bb71d6d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/routing/ic/handler.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ pub async fn handler(
6363
// Inject Host header into inner HTTP request.
6464
// HTTP2 lacks it, but canisters might expect it to be present.
6565
if parts.headers.get(HOST).is_none() {
66-
if let Ok(v) = HeaderValue::from_bytes(ctx.authority.as_bytes()) {
66+
let host = ctx.authority.to_string();
67+
if let Ok(v) = HeaderValue::from_str(&host) {
6768
parts.headers.insert(HOST, v);
6869
}
6970
}

0 commit comments

Comments
 (0)