mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-26 17:38:28 +03:00
9 lines
386 B
TypeScript
9 lines
386 B
TypeScript
import { NextFunction, Request, Response } from "express";
|
|
|
|
export function corsMiddleware(req: Request, res: Response, next: NextFunction): void {
|
|
res.header("Access-Control-Allow-Origin", "*");
|
|
res.header("Access-Control-Allow-Methods", "GET, POST, OPTIONS, DELETE");
|
|
res.header("Access-Control-Allow-Headers", "Content-Type, If-None-Match, x-client-name");
|
|
next();
|
|
}
|