Skip to content

Commit 3ac3f32

Browse files
committed
chore: handle OPTIONS
1 parent ffa6f70 commit 3ac3f32

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

functions/__/vitepress-theme.tgz.ts

+10
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
11
export async function onRequest(context) {
2+
if (context.request.method === 'OPTIONS') {
3+
// Send response to OPTIONS requests
4+
return new Response(null, {
5+
headers: {
6+
'Access-Control-Allow-Origin': '*',
7+
'Access-Control-Allow-Methods': 'GET, OPTIONS',
8+
},
9+
})
10+
}
11+
212
let response = await fetch(
313
'https://github.com/NativeScript/docs/releases/download/vitepress-theme/vitepress-theme.tgz'
414
)

0 commit comments

Comments
 (0)