Feat/url validation#284
Conversation
|
@prakshithamalla-art is attempting to deploy a commit to the vishnukothakapu's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Warning Review limit reached
More reviews will be available in 48 minutes and 17 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
pls check this file and merge |
|
Hey @prakshithamalla-art.I reviewed the changes and have a few things to flag. URL validation (lib/url.ts) The simplification looks good and fixes the deep subdomain issue. However, the original code had an extra safety check that rejected non-HTTP schemes (like ftp://, javascript:, data://) early, before even trying to parse the URL: if (hasScheme && !/^https?:/i.test(value)) { Your new version removes this and only checks url.protocol after parsing. While that works in most cases, the early rejection was an extra layer of protection. Could you add it back while keeping your simplification? Something like: export function isValidHttpUrl(value: string) { This keeps your fix for deep subdomains while still rejecting bad schemes upfront. Skeleton loader commits The two skeleton loader commits (a572e63, 144c499) are for issue #271, which is a separate feature from the URL validation fix (#270). It would be better to move those into their own PR so each PR has a single purpose. Also, the second commit just fixes an import from the first one, so those could be squashed together. Pls fix and lmk |
Overview
Closes #270. Updated the
isValidHttpUrlfunction inlib/url.tsto be more permissive with subdomains.Changes Implemented
URLconstructor with a fallback protocol. This allows the application to correctly validate and accept deep subdomains (e.g.,a.b.c.example.com) while still maintaining security by enforcinghttporhttpsprotocols.Why this improves LinkID