Skip to content

Commit

Permalink
fix(http2): preserve proxy-authenticate and proxy-authorization h…
Browse files Browse the repository at this point in the history
…eaders (#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
  • Loading branch information
nox authored Jul 16, 2021
1 parent 25d18c0 commit 5243570
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/proto/h2/mod.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
use bytes::{Buf, Bytes};
use h2::{RecvStream, SendStream};
use http::header::{
HeaderName, CONNECTION, PROXY_AUTHENTICATE, PROXY_AUTHORIZATION, TE, TRAILER,
TRANSFER_ENCODING, UPGRADE,
};
use http::header::{HeaderName, CONNECTION, TE, TRAILER, TRANSFER_ENCODING, UPGRADE};
use http::HeaderMap;
use pin_project_lite::pin_project;
use std::error::Error as StdError;
Expand Down Expand Up @@ -40,8 +37,6 @@ fn strip_connection_headers(headers: &mut HeaderMap, is_request: bool) {
let connection_headers = [
HeaderName::from_lowercase(b"keep-alive").unwrap(),
HeaderName::from_lowercase(b"proxy-connection").unwrap(),
PROXY_AUTHENTICATE,
PROXY_AUTHORIZATION,
TRAILER,
TRANSFER_ENCODING,
UPGRADE,
Expand Down

0 comments on commit 5243570

Please sign in to comment.