Skip to content

HTTP: add allow_obs_text configuration to HTTP/2 and HTTP/3 protocol options#43971

Open
fishpan1209 wants to merge 9 commits intoenvoyproxy:mainfrom
fishpan1209:gfe-e2e
Open

HTTP: add allow_obs_text configuration to HTTP/2 and HTTP/3 protocol options#43971
fishpan1209 wants to merge 9 commits intoenvoyproxy:mainfrom
fishpan1209:gfe-e2e

Conversation

@fishpan1209
Copy link
Contributor

Commit Message: HTTP: add allow_obs_text configuration to HTTP/2 and HTTP/3 protocol options
Additional Description: This change introduces a new configuration knob, allow_obs_text, to the Envoy HTTP/2 and HTTP/3 protocol options to control the validation of 'obs-text' characters (0x80-0xFF) in header field values. By default, this option is enabled to maintain consistency with existing Shinkansen behaviors and to avoid breaking legacy clients that rely on these characters. The implementation updates the underlying codec logic for both protocols to respect this setting during header validation. Comprehensive unit tests have been added for both HTTP/2 (OgHttp2) and HTTP/3 to verify that headers containing obsolete text are accepted or rejected as expected based on the configuration.
Risk Level: low
Testing: added unit tests
Docs Changes:
Release Notes:
Platform Specific Features:
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional API Considerations:]

Signed-off-by: Ting Pan <panting@google.com>
@repokitteh-read-only
Copy link

As a reminder, PRs marked as draft will not be automatically assigned reviewers,
or be handled by maintainer-oncall triage.

Please mark your PR as ready when you want it to be reviewed!

🐱

Caused by: #43971 was opened by fishpan1209.

see: more, trace.

Signed-off-by: Ting Pan <panting@google.com>
@fishpan1209
Copy link
Contributor Author

/retest

Signed-off-by: Ting Pan <panting@google.com>
Signed-off-by: Ting Pan <panting@google.com>
@fishpan1209
Copy link
Contributor Author

/retest

1 similar comment
@fishpan1209
Copy link
Contributor Author

/retest

Signed-off-by: Ting Pan <panting@google.com>
@fishpan1209 fishpan1209 marked this pull request as ready for review March 17, 2026 16:16
@repokitteh-read-only
Copy link

CC @envoyproxy/api-shepherds: Your approval is needed for changes made to (api/envoy/|docs/root/api-docs/).
envoyproxy/api-shepherds assignee is @adisuissa
CC @envoyproxy/api-watchers: FYI only for changes made to (api/envoy/|docs/root/api-docs/).

🐱

Caused by: #43971 was ready_for_review by fishpan1209.

see: more, trace.

@fishpan1209
Copy link
Contributor Author

/assign @RyanTheOptimist @wang178c
Hi Ryan, Haoyue, pls review the pr, thank you.

[(validate.rules).uint32 = {lte: 256 gte: 64}];

// Whether to allow obsolete text in header field values.
// If not set, it defaults to true.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: if the default is to allow, should we perhaps name this disallow_obs_text and have it default to false? Maybe not.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did a quick search, it is named allow_obs_text in envoy but disallow_obs_text in other context(gfe2, quiche), I'll rename it to disallow to be consistent


// Whether to allow obsolete text in header field values.
// If not set, it defaults to true.
google.protobuf.BoolValue allow_obs_text = 20;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OOC, why BoolValue instead of bool like bool allow_metadata = 6;?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bool defaults to false if missing, in our case, allow_obs_text defaults to true
we use PROTOBUF_GET_WRAPPED_OR_DEFAULT(http2_options, allow_obs_text, true) to force this later in the code.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AH, i see. So now that we're naming it disallow does that mean we can avoid PROTOBUF_GET_WRAPPED_OR_DEFAULT?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sg, updated, thank you!

Signed-off-by: Ting Pan <panting@google.com>
Signed-off-by: Ting Pan <panting@google.com>
Signed-off-by: Ting Pan <panting@google.com>
@fishpan1209
Copy link
Contributor Author

/retest

1 similar comment
@fishpan1209
Copy link
Contributor Author

/retest

Signed-off-by: Ting Pan <panting@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants