-
-
Notifications
You must be signed in to change notification settings - Fork 242
feat: check against urls with path #6416
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
) => { | ||
const urlWithProtocol = url.startsWith('http') ? url : `https://${url}`; | ||
const { hostname, pathname } = new URL(urlWithProtocol); | ||
const pathComponents = pathname.split('/').filter(Boolean); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Inconsistent URL Handling Causes Crashes
The removeURLFromBlocklistPaths
and doesURLPathExist
functions directly use new URL()
, which throws exceptions for invalid URLs. This is inconsistent with addURLToBlocklistPaths
's use of the newURL
helper, which gracefully returns null. This difference in error handling could lead to application crashes when processing malformed URLs.
Additional Locations (1)
// Level 4: remaining path segments | ||
if (remainingPaths.length === 0) { | ||
return true; // Exact match at 3-segment level | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Explanation
References
Checklist