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

uhv: add http-parser permissive parsing mode for h1 codec #20528

Closed

Conversation

ameily
Copy link
Contributor

@ameily ameily commented Mar 25, 2022

Commit Message: uhv: add http-parser permissive parsing mode for h1 codec

Additional Description: Adds a new setting to http-parser, permissive_parsing which enables permissive parsing mode (disabled by default). Strict vs permissive parsing was previously controlled by a compile time definition, HTTP_PARSER_STRICT, and my work was primarily making this a runtime flag on a per-message basis. I brought in the http-parser unit tests to make sure that nothing broke in the conversion. Then, based on the PR for H2, #20381, this underlying setting is controlled with the CodecHeaderValidationMode enumeration in the H1 codec and legacy parser. For now, all code that creates an H1 codec or parser are hardcoded to set the validation mode to Enabled to preserve the current behavior.

Risk Level: Low

Testing:

Docs Changes:

Release Notes:

Platform Specific Features:

Fixes #19750

@ameily
Copy link
Contributor Author

ameily commented Mar 25, 2022

@yanavlasov Can you take a look at this when you get a chance (assuming CI passes)?

@phlax
Copy link
Member

phlax commented Mar 25, 2022

copying out CI advice

  Please fix your editor to ensure:

      - no trailing whitespace
      - no preceding mixed tabs/spaces
      - all files end with a newline

ameily added 2 commits March 25, 2022 10:22
Signed-off-by: Adam Meily <[email protected]>
Signed-off-by: Adam Meily <[email protected]>
@adisuissa
Copy link
Contributor

@yanavlasov can you PTAL?

@repokitteh-read-only repokitteh-read-only bot added the deps Approval required for changes to Envoy's external dependencies label Apr 4, 2022
@repokitteh-read-only
Copy link

CC @envoyproxy/dependency-shepherds: Your approval is needed for changes made to (bazel/.*repos.*\.bzl)|(bazel/dependency_imports\.bzl)|(api/bazel/.*\.bzl)|(.*/requirements\.txt)|(.*\.patch).
envoyproxy/dependency-shepherds assignee is @moderation

🐱

Caused by: #20528 was synchronize by ameily.

see: more, trace.

Copy link
Contributor

@yanavlasov yanavlasov left a comment

Choose a reason for hiding this comment

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

Thanks this looks great. Just one small nit

/wait

@ameily
Copy link
Contributor Author

ameily commented Apr 7, 2022

The tests that are failing in CI are working fine locally and were previously running successfully before my last commit, which shouldn't have affected them.

@alyssawilk
Copy link
Contributor

I think we can get away with build options and testing on the compile time build - I'll let Yan touch base with you on details but please ping back after you sync with him if you have follow up questions?

@ameily
Copy link
Contributor Author

ameily commented Apr 18, 2022

I'm closing this in favor of a new solution that builds upon the uhv_enabled build flag.

@ameily ameily closed this Apr 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deps Approval required for changes to Envoy's external dependencies waiting
Projects
None yet
Development

Successfully merging this pull request may close these issues.

uhv: http-parser: add option to skip header validation
6 participants