summary refs log tree commit diff
path: root/cdn
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-10-10 12:35:46 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-10-10 12:35:46 +0200
commit3b4e026eadd1334f3f075774613ed7e8c4203b40 (patch)
tree1d3f04b27ecfb0a5bc3a1fbce1ee7aa77ff95199 /cdn
parent:bug: fix windows process.getuid (diff)
downloadserver-3b4e026eadd1334f3f075774613ed7e8c4203b40.tar.xz
:bug: fix tsc compiler
Diffstat (limited to 'cdn')
-rw-r--r--cdn/src/Server.ts14
1 files changed, 10 insertions, 4 deletions
diff --git a/cdn/src/Server.ts b/cdn/src/Server.ts
index 590eda6f..cac34a80 100644
--- a/cdn/src/Server.ts
+++ b/cdn/src/Server.ts
@@ -1,5 +1,5 @@
 import { Server, ServerOptions } from "lambert-server";
-import { Config, initDatabase } from "@fosscord/util";
+import { Config, initDatabase, registerRoutes } from "@fosscord/util";
 import path from "path";
 import avatarsRoute from "./routes/avatars";
 import bodyParser from "body-parser";
@@ -23,13 +23,19 @@ export class CDNServer extends Server {
 				"Content-security-policy",
 				"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';"
 			);
-			res.set("Access-Control-Allow-Headers", req.header("Access-Control-Request-Headers") || "*");
-			res.set("Access-Control-Allow-Methods", req.header("Access-Control-Request-Methods") || "*");
+			res.set(
+				"Access-Control-Allow-Headers",
+				req.header("Access-Control-Request-Headers") || "*"
+			);
+			res.set(
+				"Access-Control-Allow-Methods",
+				req.header("Access-Control-Request-Methods") || "*"
+			);
 			next();
 		});
 		this.app.use(bodyParser.json({ inflate: true, limit: "10mb" }));
 
-		await this.registerRoutes(path.join(__dirname, "routes/"));
+		await registerRoutes(this, path.join(__dirname, "routes/"));
 
 		this.app.use("/icons/", avatarsRoute);
 		this.log("verbose", "[Server] Route /icons registered");