Fix social URL host matching - #1172
Closed
anirudh5harma wants to merge 1 commit into
Closed
Conversation
Contributor
|
Vorflux skipped this auto review because this account has reached its Auto Review daily review limit (20/20). You can change this in Auto Review Settings: https://us1.vorflux.com/supermemory/settings?section=pull-requests |
| */ | ||
| export const isTwitterUrl = (url: string): boolean => { | ||
| const normalizedUrl = url.toLowerCase() | ||
| const parsed = parseWebUrl(url) |
Contributor
There was a problem hiding this comment.
This hostname-based check works for raw uppercase-scheme inputs, but collectValidUrls calls normalizeUrl before this helper. Because normalizeUrl("HTTP://x.com/foo") becomes https://HTTP://x.com/foo, this helper sees hostname http and collectValidUrls("", ["HTTP://x.com/foo"]) now keeps the Twitter link instead of filtering it. Making normalizeUrl detect http(s):// case-insensitively, plus a regression case through collectValidUrls, should preserve the intended behavior.
Contributor
Author
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.
Summary
Closes #1173
Tests
bun test apps/web/lib/url-helpers.test.tsbun test apps/web/lib/*.test.tsbunx biome check apps/web/lib/url-helpers.ts apps/web/lib/url-helpers.test.tsbunx turbo run check-types --filter='@supermemory/ai-sdk' --filter='@supermemory/memory-graph'Session Details
(aside)to your comment to have me ignore it.