Implement support for URI constraint matching - #515
Open
djc wants to merge 2 commits into
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #515 +/- ##
==========================================
+ Coverage 97.61% 97.69% +0.07%
==========================================
Files 20 21 +1
Lines 4070 4201 +131
==========================================
+ Hits 3973 4104 +131
Misses 97 97 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
djc
force-pushed
the
uri-constraints
branch
2 times, most recently
from
July 2, 2026 21:03
d644508 to
7d07058
Compare
ctz
reviewed
Jul 8, 2026
| /// | ||
| /// Parsing follows the generic RFC 3986 authority syntax and is intentionally minimal: anything | ||
| /// ambiguous fails closed (returns `None`). | ||
| pub(super) fn host_of(uri: untrusted::Input<'_>) -> Option<untrusted::Input<'_>> { |
Member
There was a problem hiding this comment.
Let's also:
- fuzz this? (or, better)
- have a property test that this produces the same result as a more fully-featured URL parsing crate?
Member
Author
There was a problem hiding this comment.
I haven't really done property testing before, but Claude used the propertytest crate to whip something up which looks credible at least. Do you have experience with property testing frameworks for Rust?
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.
Based on the RFC and the Go implementation.
(With help from Claude.)
Fixes #514.