Repository navigation
Add unsatisfied_requirements() for unclaimed req- params - #14
Closed
caarloshenriq wants to merge 1 commit into
Closed
caarloshenriq wants to merge 1 commit into
caarloshenriq wants to merge 1 commit into
Conversation
Add a new field and public accessor to `Uri`. This reports the req- parameter keys that were present in a URI but not claimed by `extras`. Always empty for a `Uri` built through `FromStr` or `TryFrom<&str>`, since those already fail immediately on the first unclaimed req- parameter, per BIP21. Add two new opt-in entry points, `Uri::parse_permissive` and `Uri::try_parse_permissive`, that share the same parsing logic via a new `deserialize_raw_impl(string, permissive)` but do not fail on an unclaimed req- parameter. Instead they record its key and keep parsing, letting a caller decide afterward whether to accept the URI anyway.
This was referenced Sep 29, 2026
Member
|
When do we want this to be permissive? don't we always want to error if there's an unknown req-? |
Author
Right, the permissive/strict split doesn't belong in the parser, it can't know which |
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.
Part of #12
Add a new field and public accessor to
Uri. This reports the req- parameter keys that were present in a URI but not claimed byextras. Always empty for aUribuilt throughFromStrorTryFrom<&str>, since those already fail immediately on the first unclaimed req- parameter, per BIP21.Add two new opt-in entry points,
Uri::parse_permissiveandUri::try_parse_permissive, that share the same parsing logic via a newdeserialize_raw_impl(string, permissive)but do not fail on an unclaimed req- parameter. Instead they record its key and keep parsing, letting a caller decide afterward whether to accept the URI anyway.Disclosure: co-authored by Claude