diff --git a/apps/studio/lib/api/edgeFunctions.test.ts b/apps/studio/lib/api/edgeFunctions.test.ts index 54e0af1f63e..76ac26dda3d 100644 --- a/apps/studio/lib/api/edgeFunctions.test.ts +++ b/apps/studio/lib/api/edgeFunctions.test.ts @@ -4,10 +4,10 @@ import { isValidEdgeFunctionURL } from './edgeFunctions' describe('isValidEdgeFunctionURL', () => { const validEdgeFunctionUrls = [ - 'https://projectref.supabase.co/functions/v1/hello-world', - 'https://projectref.supabase.red/functions/v1/hello-world', - 'https://projectref.supabase.red/functions/v3/hello-world', - 'https://projectref.supabase.red/functions/v3/hello-world', + 'https://uniquetwentychararef.supabase.co/functions/v1/hello-world', + 'https://uniquetwentychararef.supabase.red/functions/v1/hello-world', + 'https://uniquetwentychararef.supabase.red/functions/v3/hello-world', + 'https://uniquetwentychararef.supabase.red/functions/v3/hello-world', ] const validLocalEdgeFunctionsUrls = [ diff --git a/apps/studio/lib/api/edgeFunctions.ts b/apps/studio/lib/api/edgeFunctions.ts index 15b0138328a..4a1a4817436 100644 --- a/apps/studio/lib/api/edgeFunctions.ts +++ b/apps/studio/lib/api/edgeFunctions.ts @@ -9,14 +9,14 @@ export const isValidEdgeFunctionURL = (url: string, isPlatform: boolean) => { if (!isPlatform) { const regexValidLocalEdgeFunctionURL = new RegExp( - '^https?://[^\\s/?#]+/functions/v[0-9]{1}/.*$' + /^https?:\/\/[^\s/?#]+\/functions\/v[0-9]{1}\/.*$/ ) return regexValidLocalEdgeFunctionURL.test(url) } const regexValidEdgeFunctionURL = new RegExp( - '^https://[a-z]*.supabase.(red|co)/functions/v[0-9]{1}/.*$' + /^https:\/\/[a-z]{20}\.supabase\.(red|co)\/functions\/v[0-9]{1}\/.*$/ ) return regexValidEdgeFunctionURL.test(url)