E-Mail Anhang-Download CORS absichern
KI-AGENT: OPTIONS-Preflights werden nicht mehr durch den Auth-Hook blockiert und der E-Mail Anhang-Download setzt CORS-Header auch für Fehlerantworten explizit.
This commit is contained in:
@@ -64,6 +64,10 @@ export default fp(async (server: FastifyInstance) => {
|
||||
}
|
||||
|
||||
server.addHook("preHandler", async (req, reply) => {
|
||||
if (req.method === "OPTIONS") {
|
||||
return
|
||||
}
|
||||
|
||||
// 1️⃣ Token aus Header oder Cookie lesen
|
||||
const cookieToken = req.cookies?.token
|
||||
const authHeader = req.headers.authorization
|
||||
|
||||
Reference in New Issue
Block a user