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: https://github.com/openwebdocs/project/issues/43
This commit is contained in:
@@ -1,9 +1,6 @@
|
|||||||
use bytes::{Buf, Bytes};
|
use bytes::{Buf, Bytes};
|
||||||
use h2::{RecvStream, SendStream};
|
use h2::{RecvStream, SendStream};
|
||||||
use http::header::{
|
use http::header::{HeaderName, CONNECTION, TE, TRAILER, TRANSFER_ENCODING, UPGRADE};
|
||||||
HeaderName, CONNECTION, PROXY_AUTHENTICATE, PROXY_AUTHORIZATION, TE, TRAILER,
|
|
||||||
TRANSFER_ENCODING, UPGRADE,
|
|
||||||
};
|
|
||||||
use http::HeaderMap;
|
use http::HeaderMap;
|
||||||
use pin_project_lite::pin_project;
|
use pin_project_lite::pin_project;
|
||||||
use std::error::Error as StdError;
|
use std::error::Error as StdError;
|
||||||
@@ -40,8 +37,6 @@ fn strip_connection_headers(headers: &mut HeaderMap, is_request: bool) {
|
|||||||
let connection_headers = [
|
let connection_headers = [
|
||||||
HeaderName::from_lowercase(b"keep-alive").unwrap(),
|
HeaderName::from_lowercase(b"keep-alive").unwrap(),
|
||||||
HeaderName::from_lowercase(b"proxy-connection").unwrap(),
|
HeaderName::from_lowercase(b"proxy-connection").unwrap(),
|
||||||
PROXY_AUTHENTICATE,
|
|
||||||
PROXY_AUTHORIZATION,
|
|
||||||
TRAILER,
|
TRAILER,
|
||||||
TRANSFER_ENCODING,
|
TRANSFER_ENCODING,
|
||||||
UPGRADE,
|
UPGRADE,
|
||||||
|
|||||||
Reference in New Issue
Block a user