Repository navigation
Apply robots specificity to blanket allow rules - #43
Merged
Merged
Conversation
The equivalent-allow fix treated every root-covering rule as equal. RFC 9309 chooses the most specific match, so Disallow: /* (2 octets) still blocks when paired with Allow: / (1 octet), while Allow: /** lifts it. Track the longest root-covering allow and disallow patterns, keep the allow-wins tie rule, and add wildcard cases to the probe harness. Narrow allows still do not lift a blanket disallow.
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.
Follow-up to #39: the equivalent-allow fix treated every root-covering rule as equal.
Problem
RFC 9309 §2.2.2 chooses the most specific match, with an equally specific allow winning.
Disallow: /*(2 octets) is more specific thanAllow: /(1 octet), so that pair should still cap. The previous code let any root allow lift any root disallow.What changed
rootCoveringLengthrecognizes patterns that permit every path:/,/*,/**,/*$and longer star runs.Disallow: /*+Allow: /blocks; equal/*allows; more specific/**allows.Before and after
*Disallow: /*,Allow: /Disallow: /*,Allow: /*Disallow: /*,Allow: /**Disallow: /,Allow: /Disallow: /,Allow: /publicVerification
npm run check— exit 0, 145 unit tests, 5 integration tests, package and bundle checksnpm run test:browser— exit 0Boundary
This is still a heuristic for blanket blocks, not a complete robots policy engine or an authorization check.