Use string_view in CookieParser::before_handle parsing#1024
Merged
gittiver merged 1 commit intoOct 15, 2025
Conversation
Contributor
Author
|
I tested the implementation against the old one using these: std::vector<std::string> test_cookies = {
// Basic cases
"key=value",
"key1=value1; key2=value2",
" key=value ",
"key = value ; nextkey = anothervalue ",
// Quoted values
"key=\"value\"",
"key=\"\"",
" key = \" spaced value \" ",
"key=\"value with ; inside\"",
"key=\"value with = inside\"",
"key=",
"key=;next=val",
"key= ; next=val",
// Edge cases
"",
"key",
"=",
"=value",
" key = ",
"key=value;"
";key=value",
"key1=value1;;key2=value2",
"key= value ",
"key=\" value \"",
"utf8key=你好世界; other=val",
"special=!@#$%^&*()_+",
"SID=abc; something=\"\"; key3=val3"
}; |
b7b229e to
7fb3152
Compare
Member
|
OSX uses a newer version of asio which has some deprecated functions removed. |
Member
|
can you rebase the pull request to newest main, there was a problem with deprecated functions in asio, this let all osx builds fail due to a newer version of asio used there. |
Member
|
Could you rebase on current master? |
7fb3152 to
588bb65
Compare
Contributor
Author
|
My apologies, github decided to never notify me of these comments |
Member
|
no worries, i will also need some time to proceed on it. ;) |
Contributor
Author
|
status on this? |
gittiver
reviewed
Oct 14, 2025
gittiver
approved these changes
Oct 14, 2025
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.
This PR refactors
CookieParser::before_handleto usestd::string_viewfor parsing theCookierequest header, avoiding extrastd::stringallocations during slicing and trimmingTested against the original code with around 20 inputs, confirming identical output maps and rejection behavior.
Closes #1023