Namespace/subpath: simplify parsing#452
Closed
ppkarwasz wants to merge 2 commits intopackage-url:mainfrom
Closed
Conversation
This PR: - Uniformizes the treatment of `namespace` and `subpath`: all segments that are empty or equal to one of `.` or `..` should be discarded. - Moves the check for `.` and `..` segments after UTF-8 decoding. This ensures that overlong encoding of `.` (like `%C0%AE`, `%E0%80%AE`, `%F0%80%80%AE`) are also discarded. - Requires the parser to throw an error if an (percent-encoded) solidus `/` is encountered in any path segment. Signed-off-by: Piotr P. Karwasz <[email protected]>
Member
jkowalleck
reviewed
Apr 9, 2025
jkowalleck
reviewed
Apr 9, 2025
Contributor
|
Does this simplify namespaces? This seems like it only makes namespaces more complicated. Unlike subpaths, namespaces do not care about |
Member
|
Seams about right. Anyway, @ppkarwasz, could you close this particular PR and split it intwo two separate ones, one for each of the scopes? These two PRs could then be worked on independently in their own pace. |
Co-authored-by: Jan Kowalleck <[email protected]>
jkowalleck
requested changes
Apr 9, 2025
This was referenced Apr 10, 2025
Contributor
Author
|
I am closing this, since I split it as suggested into: |
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:
namespaceandsubpath: all segments that are empty or equal to one of.or..should be discarded..and..segments after UTF-8 decoding. This ensures that overlong encoding of.(like%C0%AE,%E0%80%AE,%F0%80%80%AE) are also discarded./is encountered in any path segment.