Skip to content
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

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

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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions benches/src/header_map/basic.rs
Expand Up @@ -551,6 +551,7 @@ const STD: &'static [HeaderName] = &[
COOKIE,
DNT,
DATE,
EARLY_DATA,
ETAG,
EXPECT,
EXPIRES,
Expand Down
1 change: 1 addition & 0 deletions src/header/mod.rs
Expand Up @@ -116,6 +116,7 @@ pub use self::name::{
COOKIE,
DNT,
DATE,
EARLY_DATA,
ETAG,
EXPECT,
EXPIRES,
Expand Down
3 changes: 3 additions & 0 deletions src/header/name.rs
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions src/status.rs
Expand Up @@ -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");
Expand Down
1 change: 1 addition & 0 deletions tests/header_map.rs
Expand Up @@ -361,6 +361,7 @@ const STD: &'static [HeaderName] = &[
COOKIE,
DNT,
DATE,
EARLY_DATA,
ETAG,
EXPECT,
EXPIRES,
Expand Down
1 change: 1 addition & 0 deletions tests/header_map_fuzz.rs
Expand Up @@ -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,
Expand Down