Skip to content

Implement the Early-Data (RFC 8470) header #606

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions benches/src/header_map/basic.rs
Original file line number Diff line number Diff line change
@@ -551,6 +551,7 @@ const STD: &'static [HeaderName] = &[
COOKIE,
DNT,
DATE,
EARLY_DATA,
ETAG,
EXPECT,
EXPIRES,
1 change: 1 addition & 0 deletions src/header/mod.rs
Original file line number Diff line number Diff line change
@@ -116,6 +116,7 @@ pub use self::name::{
COOKIE,
DNT,
DATE,
EARLY_DATA,
ETAG,
EXPECT,
EXPIRES,
3 changes: 3 additions & 0 deletions src/header/name.rs
Original file line number Diff line number Diff line change
@@ -485,6 +485,9 @@ standard_headers! {
/// Contains the date and time at which the message was originated.
(Date, DATE, b"date");

/// Indicates that the request has been conveyed in early data and that a client understands the 425 (Too Early) status code.
(EarlyData, EARLY_DATA, b"early-data");

/// Identifier for a specific version of a resource.
///
/// This header allows caches to be more efficient, and saves bandwidth, as
4 changes: 4 additions & 0 deletions src/status.rs
Original file line number Diff line number Diff line change
@@ -459,6 +459,10 @@ status_codes! {
/// [[RFC4918](https://tools.ietf.org/html/rfc4918)]
(424, FAILED_DEPENDENCY, "Failed Dependency");

/// 425 Too Early
/// [[RFC8470](https://datatracker.ietf.org/doc/html/rfc8470#section-5.2)]
(425, TOO_EARLY, "Too Early");

/// 426 Upgrade Required
/// [[RFC7231, Section 6.5.15](https://tools.ietf.org/html/rfc7231#section-6.5.15)]
(426, UPGRADE_REQUIRED, "Upgrade Required");
1 change: 1 addition & 0 deletions tests/header_map.rs
Original file line number Diff line number Diff line change
@@ -361,6 +361,7 @@ const STD: &'static [HeaderName] = &[
COOKIE,
DNT,
DATE,
EARLY_DATA,
ETAG,
EXPECT,
EXPIRES,
1 change: 1 addition & 0 deletions tests/header_map_fuzz.rs
Original file line number Diff line number Diff line change
@@ -297,6 +297,7 @@ fn gen_header_name(g: &mut StdRng) -> HeaderName {
header::COOKIE,
header::DNT,
header::DATE,
header::EARLY_DATA,
header::ETAG,
header::EXPECT,
header::EXPIRES,