Repository navigation
Add a standalone HTTP/1.1 request-head parser - #3112
Open
HarshPopat23 wants to merge 5 commits into
Open
HarshPopat23 wants to merge 5 commits into
HarshPopat23 wants to merge 5 commits into
Conversation
Signed-off-by: HarshPopat23 <musichk61@gmail.com>
🤖 Augment PR SummaryAdds
🤖 Was this summary useful? React with 👍 or 👎 |
Signed-off-by: HarshPopat23 <musichk61@gmail.com>
Signed-off-by: HarshPopat23 <musichk61@gmail.com>
Signed-off-by: HarshPopat23 <musichk61@gmail.com>
Contributor
Author
|
PTAL : @jviotti |
jviotti
reviewed
Nov 22, 2026
| /// The request target as sent, or an empty view unless complete. | ||
| std::string_view target{}; | ||
| /// Field names and values in wire order, including repeated names. | ||
| std::vector<std::pair<std::string_view, std::string_view>> fields{}; |
Member
There was a problem hiding this comment.
Shouldn't this be called "headers"? In general, can you go through the HTTP RFCs and make sure we match their terminology exactly?
jviotti
reviewed
Nov 22, 2026
| /// Callers can append input and retry from the beginning when incomplete. | ||
| /// Keep the input alive and unmodified while using the returned views. | ||
| SOURCEMETA_CORE_HTTP_EXPORT | ||
| auto http_parse_request_head(std::string_view input) -> HTTPRequestHead; |
Member
There was a problem hiding this comment.
I think the word _head here is confusing. Maybe _envelope or see what the RFCs actually use if any
jviotti
reviewed
Nov 22, 2026
Member
There was a problem hiding this comment.
Is there any official suite somewhere we could use too? There must be some re-usable HTTP parsing test suites somewhere right?
jviotti
reviewed
Nov 22, 2026
| /// Callers can append input and retry from the beginning when incomplete. | ||
| /// Keep the input alive and unmodified while using the returned views. | ||
| SOURCEMETA_CORE_HTTP_EXPORT | ||
| auto http_parse_request_head(std::string_view input) -> HTTPRequestHead; |
Member
There was a problem hiding this comment.
Suggested change
| auto http_parse_request_head(std::string_view input) -> HTTPRequestHead; | |
| auto http_parse_request_head(const std::string_view input) -> HTTPRequestHead; |
just as a convention nit pick
Signed-off-by: HarshPopat23 <musichk61@gmail.com>
Contributor
Author
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
http_parse_request_headto Core as a standalone API for parsing the HTTP/1.1 request line and headers directly from a byte buffer.This first PR focuses on request-head syntax. Request-target semantics,
Hostvalidation, and body framing are follow-up work.Verification