mirror of
https://github.com/supabase/supabase.git
synced 2026-06-11 15:10:18 +08:00
## I have read the [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) file. YES ## What kind of change does this PR introduce? Bug fix ## What is the current behavior? Only checks the for a valid URL that has hostname of vercel.com. ## What is the new behavior? Ensures the URL protocol is HTTPS ## Additional context Vercel will never load over any other protocol than HTTPS
10 lines
231 B
TypeScript
10 lines
231 B
TypeScript
export function isVercelUrl(url: string): boolean {
|
|
try {
|
|
const u = new URL(url)
|
|
return u.protocol === 'https:' && u.hostname === 'vercel.com'
|
|
} catch {
|
|
// If the URL is invalid, return false
|
|
return false
|
|
}
|
|
}
|