mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2025-07-19 12:03:37 +00:00
fix: cors
This commit is contained in:
@@ -3,7 +3,8 @@ import type { RequestHandler } from 'express';
|
|||||||
// CORS 中间件,跨域用
|
// CORS 中间件,跨域用
|
||||||
export const cors: RequestHandler = (_, res, next) => {
|
export const cors: RequestHandler = (_, res, next) => {
|
||||||
res.header('Access-Control-Allow-Origin', '*');
|
res.header('Access-Control-Allow-Origin', '*');
|
||||||
res.header('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, OPTIONS');
|
res.header('Access-Control-Allow-Methods', '*');
|
||||||
res.header('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept, Authorization');
|
res.header('Access-Control-Allow-Headers', '*');
|
||||||
|
res.header('Access-Control-Allow-Credentials', 'true');
|
||||||
next();
|
next();
|
||||||
};
|
};
|
Reference in New Issue
Block a user