Skip to content

Commit a3269f7

Browse files
authoredApr 26, 2024··
fix(http2): stop removing "Trailer" header in HTTP/2 responses as per RFC 9110 (#3648)
1 parent 226305d commit a3269f7

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed
 

‎src/proto/h2/mod.rs

+3-5
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use std::task::{Context, Poll};
88
use bytes::{Buf, Bytes};
99
use futures_util::ready;
1010
use h2::{Reason, RecvStream, SendStream};
11-
use http::header::{HeaderName, CONNECTION, TE, TRAILER, TRANSFER_ENCODING, UPGRADE};
11+
use http::header::{HeaderName, CONNECTION, TE, TRANSFER_ENCODING, UPGRADE};
1212
use http::HeaderMap;
1313
use pin_project_lite::pin_project;
1414

@@ -31,15 +31,13 @@ cfg_server! {
3131
/// Default initial stream window size defined in HTTP2 spec.
3232
pub(crate) const SPEC_WINDOW_SIZE: u32 = 65_535;
3333

34-
// List of connection headers from:
35-
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Connection
34+
// List of connection headers from RFC 9110 Section 7.6.1
3635
//
3736
// TE headers are allowed in HTTP/2 requests as long as the value is "trailers", so they're
3837
// tested separately.
39-
static CONNECTION_HEADERS: [HeaderName; 5] = [
38+
static CONNECTION_HEADERS: [HeaderName; 4] = [
4039
HeaderName::from_static("keep-alive"),
4140
HeaderName::from_static("proxy-connection"),
42-
TRAILER,
4341
TRANSFER_ENCODING,
4442
UPGRADE,
4543
];

0 commit comments

Comments
 (0)
Please sign in to comment.