[pbs-devel] [PATCH proxmox-backup] fix #4779: client: add missing "Connection" header for HTTP2 upgrade

Max Carrara m.carrara at proxmox.com
Thu Oct 19 10:57:24 CEST 2023


This commit adds the missing "Connection: upgrade" HTTP header[1]
when requesting an upgrade to HTTP 2.

[1]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Upgrade

Reported-By: McTwist <rajb89 at hotmail.com>
Signed-off-by: Max Carrara <m.carrara at proxmox.com>
---
 pbs-client/src/http_client.rs | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/pbs-client/src/http_client.rs b/pbs-client/src/http_client.rs
index 90d0d04b..b803c19f 100644
--- a/pbs-client/src/http_client.rs
+++ b/pbs-client/src/http_client.rs
@@ -764,6 +764,8 @@ impl HttpClient {
             );
         }
 
+        req.headers_mut()
+            .insert("Connection", HeaderValue::from_str("upgrade").unwrap());
         req.headers_mut()
             .insert("UPGRADE", HeaderValue::from_str(&protocol_name).unwrap());
 
-- 
2.39.2






More information about the pbs-devel mailing list