FeatureFuel
1

Clarification: URL validation scope between isValidLink and message composer

Source: RocketChat/Rocket.Chat#38999 · opened by @harshlocham
Clarification: URL validation scope between isValidLink and message composer Hi team 👋 While reviewing recent changes around isValidLink, I noticed that it currently validates URL syntax using the native URL constructor, which allows all valid schemes (e.g. http:, https:, data:, etc.). This seems intentional, as data:image/... URLs are used across the codebase (avatars, previews, stories, tests, etc.). However, in the context of the Add Link modal in the message composer, the original intent appeared to focus on ensuring links start with http:// or That made me wonder whether we should clearly separate responsibilities: • Keep isValidLink as a generic syntax validator • Allow UI components (like the composer) to optionally enforce stricter protocol checks when needed (e.g., external http/https only) • Continue handling security concerns at the sanitization layer Would this separation make sense architecturally, or is the current behavior prefe…

No pledges yet. Be the first to back this.

Make a pledge

Pledge your monetary support if this feature is added.

$

Comments

No comments yet.

Replying to

Add a comment

What do you think about this feature request?


Similar requests