From 120f166a45b0e2bb7fe1b70f98ba264f7ec30717 Mon Sep 17 00:00:00 2001 From: highperfocused Date: Tue, 6 May 2025 18:17:06 +0200 Subject: [PATCH] fix: add header cors for well-known public folder --- next.config.mjs | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/next.config.mjs b/next.config.mjs index c369c9c..ea9ca17 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -5,17 +5,31 @@ const config = { }; const nextConfig = { - output: 'standalone', - images: { - remotePatterns: [ - { - protocol: 'https', - hostname: '**', - port: '', - pathname: '/**', - }, - ], + output: 'standalone', + images: { + remotePatterns: [ + { + protocol: 'https', + hostname: '**', + port: '', + pathname: '/**', }, + ], + }, + async headers() { + return [ + { + // matching all well-known routes + source: "/.well-known/:path*", + headers: [ + // { key: "Access-Control-Allow-Credentials", value: "true" }, + { key: "Access-Control-Allow-Origin", value: "*" }, + { key: "Access-Control-Allow-Methods", value: "GET" }, + // { key: "Access-Control-Allow-Headers", value: "X-CSRF-Token, X-Requested-With, Accept, Accept-Version, Content-Length, Content-MD5, Content-Type, Date, X-Api-Version" }, + ] + } + ] + } }; export default withPWA(config)(nextConfig); \ No newline at end of file