fix middleware orderingon cdn

This commit is contained in:
Rory& committed 2026-10-19 13:16:29 +02:00
1 parent 9915fe1ff6
commit da8afc696d
2 files changed
+4 -6

No files matched your search

+2 -4
View File
@@ -32,9 +32,7 @@ export function CORS(req: Request, res: Response, next: NextFunction) {
"default-src * data: blob: filesystem: about: ws: wss: 'unsafe-inline' 'unsafe-eval'; script-src * data: blob: 'unsafe-inline' 'unsafe-eval'; connect-src * data: blob: 'unsafe-inline'; img-src * data: blob: 'unsafe-inline'; frame-src * data: blob: ; style-src * data: blob: 'unsafe-inline'; font-src * data: blob: 'unsafe-inline';",
);
if (req.method === "OPTIONS") {
res.status(204).send();
return;
}
if (req.method === "OPTIONS") return res.sendStatus(204);
next();
}
+2 -2
View File
@@ -67,10 +67,10 @@ export class CDNServer extends Server {
this.app.disable("x-powered-by");
this.app.use(Authentication);
this.app.use(ErrorHandler);
this.app.use(CORS);
this.app.use(Authentication);
this.app.use(BodyParser({ inflate: true, limit: "10mb" }));
this.app.use(ErrorHandler);
await registerRoutes(this, path.join(__dirname, "routes/"));