mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-21 23:18:21 +03:00
add allow-headers content-type
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
if ($request_method = 'OPTIONS') {
|
||||
add_header 'Access-Control-Allow-Origin' '*';
|
||||
add_header 'Access-Control-Allow-Methods' 'GET, POST, DELETE';
|
||||
add_header 'Access-Control-Allow-Headers', 'Content-Type'
|
||||
# cache CORS for 24 hours
|
||||
add_header 'Access-Control-Max-Age' 86400;
|
||||
# return empty response for preflight
|
||||
|
||||
@@ -3,5 +3,6 @@ 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");
|
||||
next();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user