urlapi: preserve empty markers in relative URLs - #22298
Closed
Alb3e3 wants to merge 2 commits into
Closed
Conversation
bagder
requested changes
Jul 12, 2026
bagder
left a comment
Member
There was a problem hiding this comment.
This looks like a perfectly fine change, thanks! I would however prefer the test code to be added to test 1560 instead (lib1560.c) since it can be a libtest, not a unit test, and 1560 is already doing most of the URL API testing.
Contributor
Author
|
Moved the URL API regression coverage into |
bagder
approved these changes
Jul 21, 2026
Member
|
Thanks! |
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.
What
Relative URL resolution currently loses explicit empty query/fragment markers when those markers are needed to compute the splice point.
Example before this patch:
Expected:
Actual before this patch:
The empty query marker is significant when the caller asks for empty components with
CURLU_GET_EMPTY.This patch fixes the relative-resolution path by:
query_presentandfragment_presentwhen choosing the cutoff point, instead of only checking for non-empty query/fragment stringsunit1675coverage for fragment-only, query-only, and path-relative references across explicit empty query/fragment markersTests
I also checked the public URL API behavior with a small local probe for the examples above.
Disclosure: AI assistance was used while inspecting and drafting this patch; the behavior and focused tests listed above were verified locally.