Skip to content

Conversation

imblue-dabadee
Copy link
Contributor

Explanation

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed, highlighting breaking changes as necessary
  • I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes

@imblue-dabadee imblue-dabadee requested a review from a team as a code owner August 29, 2025 04:15
@imblue-dabadee imblue-dabadee marked this pull request as draft August 29, 2025 04:15
@imblue-dabadee imblue-dabadee marked this pull request as ready for review August 29, 2025 21:33
) => {
const urlWithProtocol = url.startsWith('http') ? url : `https://${url}`;
const { hostname, pathname } = new URL(urlWithProtocol);
const pathComponents = pathname.split('/').filter(Boolean);
Copy link

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)

Fix in Cursor Fix in Web

// Level 4: remaining path segments
if (remainingPaths.length === 0) {
return true; // Exact match at 3-segment level
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: URL Path Existence Bug

The doesURLPathExist function incorrectly returns true for URLs with exactly three path components. This happens when the blocklist entry for the third path component contains specific deeper paths, implying the three-segment path itself is not blocked.

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant