mirror of
https://github.com/supabase/supabase.git
synced 2026-10-07 02:15:05 +03:00
Merge pull request #9178 from supabase/laktek-patch-2
This commit is contained in:
1 file changed
+6
@@ -290,12 +290,18 @@ We recommend using hyphens to name functions because hyphens are the most URL-fr
|
||||
We recommend adding a check to handle [CORS Preflight](https://developer.mozilla.org/en-US/docs/Glossary/Preflight_request) requests in your edge function to be able to invoke the function from browsers.
|
||||
|
||||
```ts
|
||||
export const corsHeaders = {
|
||||
'Access-Control-Allow-Origin': '*',
|
||||
'Access-Control-Allow-Headers': 'authorization, x-client-info, apikey',
|
||||
}
|
||||
|
||||
serve(async (req) => {
|
||||
if (req.method === 'OPTIONS') {
|
||||
return new Response('ok', { headers: corsHeaders })
|
||||
}
|
||||
...
|
||||
})
|
||||
```
|
||||
|
||||
## Limitations
|
||||
|
||||
|
||||
Reference in new issue
Block a user