mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-01-17 13:50:36 +00:00
fix
This commit is contained in:
parent
46254a699a
commit
b6b7f2051b
@ -4,8 +4,8 @@ import type { RequestHandler } from 'express';
|
|||||||
export const cors: RequestHandler = (req, res, next) => {
|
export const cors: RequestHandler = (req, res, next) => {
|
||||||
const origin = req.headers.origin || '*';
|
const origin = req.headers.origin || '*';
|
||||||
res.header('Access-Control-Allow-Origin', origin);
|
res.header('Access-Control-Allow-Origin', origin);
|
||||||
res.header('Access-Control-Allow-Methods', '*');
|
res.header('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, OPTIONS');
|
||||||
res.header('Access-Control-Allow-Headers', '*');
|
res.header('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept, Authorization');
|
||||||
res.header('Access-Control-Allow-Credentials', 'true');
|
res.header('Access-Control-Allow-Credentials', 'true');
|
||||||
|
|
||||||
if (req.method === 'OPTIONS') {
|
if (req.method === 'OPTIONS') {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user