mirror of
https://github.com/spacebarchat/server.git
synced 2026-11-04 19:58:52 +00:00
fix middleware orderingon cdn
This commit is contained in:
1 parent
9915fe1ff6
commit
da8afc696d
2 files changed
+4
-6
No files matched your search
@@ -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
@@ -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/"));
|
||||
|
||||
|
||||
Reference in new issue
Block a user