mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-12-05 14:26:23 +01:00
Send the client's Host as :authority to HTTP/2 upstreams
Dropping Host lost a virtual host that differs from the CONNECT target. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
11aca4539d
commit
4abc882e13
2 files changed
+25
-14
No files matched your search
@@ -441,6 +441,17 @@ async fn https_h2_upstream_gets_authority_without_host() {
|
||||
assert!(captured_host, "the captured request keeps Host");
|
||||
}
|
||||
|
||||
/// A `Host` other than the CONNECT target still names the virtual host upstream.
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn https_h2_upstream_gets_the_clients_host_as_authority() {
|
||||
let h = Harness::start(1024);
|
||||
let upstream = spawn_upstream(Some(h.pki.server.clone())).await;
|
||||
let url = format!("https://localhost:{}/authority", upstream.port());
|
||||
|
||||
let resp = h.client().get(&url).header("host", "yaak.test:8443").send().await.unwrap();
|
||||
assert_eq!(resp.text().await.unwrap(), "authority=yaak.test:8443 host=none");
|
||||
}
|
||||
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn https_not_found() {
|
||||
let h = Harness::start(1024);
|
||||
|
||||
Reference in new issue
Block a user