Skip to content

Commit 5243570

Browse files
authoredJul 16, 2021
fix(http2): preserve proxy-authenticate and proxy-authorization headers (#2597)
That Proxy-Authenticate and Proxy-Authorization are forbidden over h2 is not actually specified anywhere, plus h2 also supports CONNECT requests, which are specifically made to do requests over a proxy, and those proxies may require authentication, sometimes through Proxy-Authorization. Note that there is an openwebdocs project that just started to clear up any MDN-induced confusion in implementations: openwebdocs/project#43
1 parent 25d18c0 commit 5243570

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed
 

‎src/proto/h2/mod.rs

+1-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
use bytes::{Buf, Bytes};
22
use h2::{RecvStream, SendStream};
3-
use http::header::{
4-
HeaderName, CONNECTION, PROXY_AUTHENTICATE, PROXY_AUTHORIZATION, TE, TRAILER,
5-
TRANSFER_ENCODING, UPGRADE,
6-
};
3+
use http::header::{HeaderName, CONNECTION, TE, TRAILER, TRANSFER_ENCODING, UPGRADE};
74
use http::HeaderMap;
85
use pin_project_lite::pin_project;
96
use std::error::Error as StdError;
@@ -40,8 +37,6 @@ fn strip_connection_headers(headers: &mut HeaderMap, is_request: bool) {
4037
let connection_headers = [
4138
HeaderName::from_lowercase(b"keep-alive").unwrap(),
4239
HeaderName::from_lowercase(b"proxy-connection").unwrap(),
43-
PROXY_AUTHENTICATE,
44-
PROXY_AUTHORIZATION,
4540
TRAILER,
4641
TRANSFER_ENCODING,
4742
UPGRADE,

0 commit comments

Comments
 (0)