fix: only accept https:// in isLikelyValidUrl to prevent auth tokens being sent over plain HTTP#2911
Conversation
…prevent auth tokens sent over plain HTTP
|
@akhilmodi29 is attempting to deploy a commit to the ritesh Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughIn ChangesHTTPS-only URL Validation
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
Summary
Removes http:// acceptance from isLikelyValidUrl in supabaseClient.js
so a misconfigured plain HTTP URL correctly falls back to the safe
disabled client instead of creating a real Supabase connection.
Problem
isLikelyValidUrl accepted both https:// and http://. A misconfigured
VITE_SUPABASE_URL with http:// passed validation and created a real
Supabase client, transmitting auth tokens over plain HTTP.
Fix
Removed || parsed.protocol === 'http:' from the protocol check.
Only https:// is now accepted matching Supabase's requirement.
Changes
Closes #2910
Summary by CodeRabbit