From b21c881455fe13d7b06bcc2da8948d30ef752d0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B3=E5=85=83=E7=9A=93?= Date: Wed, 28 May 2025 17:48:21 +0800 Subject: [PATCH] Update cors settings. --- nuxt.config.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/nuxt.config.ts b/nuxt.config.ts index 4706664..430c739 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -18,6 +18,14 @@ export default defineNuxtConfig({ "/wp-login.php": { redirect: "https://s3.yhw.tw/data/def-zip-bomb/wp-login.php.zip", }, + "/api/**": { + cors: true, + headers: { + "Access-Control-Allow-Origin": "*", + "Access-Control-Allow-Methods": "GET,HEAD,PUT,PATCH,POST,DELETE,OPTIONS", + "Access-Control-Allow-Headers": "Content-Type, Authorization, X-Requested-With", + }, + }, "/api/cached/**": { swr: 3600 }, "/api/news/get": { swr: 3600 }, "/api/home/lt": { swr: 3600 },