From 5483ea1ce9d08cd57b7cf331c704a7fe7b7db532 Mon Sep 17 00:00:00 2001 From: AlTech98 Date: Wed, 8 Sep 2021 18:42:58 +0200 Subject: [PATCH 1/2] Increased CDN max upload to 10mb --- cdn/src/Server.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cdn/src/Server.ts b/cdn/src/Server.ts index f4a6b576..63499ce4 100644 --- a/cdn/src/Server.ts +++ b/cdn/src/Server.ts @@ -2,6 +2,7 @@ import { Server, ServerOptions } from "lambert-server"; import { Config, initDatabase } from "@fosscord/util"; import path from "path"; import avatarsRoute from "./routes/avatars"; +import bodyParser from "body-parser"; export interface CDNServerOptions extends ServerOptions {} @@ -26,6 +27,8 @@ export class CDNServer extends Server { res.set("Access-Control-Allow-Methods", req.header("Access-Control-Request-Methods") || "*"); next(); }); + this.app.use(bodyParser.json({ inflate: true, limit: "10mb" })); + this.app.use(bodyParser.urlencoded({ inflate: true, limit: "10mb" })); await this.registerRoutes(path.join(__dirname, "routes/")); From ae59f4bafbeadd17bbe2e3bbd22dc6cbe17d6128 Mon Sep 17 00:00:00 2001 From: AlTech98 Date: Thu, 9 Sep 2021 07:50:00 +0200 Subject: [PATCH 2/2] Removed urlencoded bodyparser --- cdn/src/Server.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/cdn/src/Server.ts b/cdn/src/Server.ts index 63499ce4..5c4a8ae5 100644 --- a/cdn/src/Server.ts +++ b/cdn/src/Server.ts @@ -28,7 +28,6 @@ export class CDNServer extends Server { next(); }); this.app.use(bodyParser.json({ inflate: true, limit: "10mb" })); - this.app.use(bodyParser.urlencoded({ inflate: true, limit: "10mb" })); await this.registerRoutes(path.join(__dirname, "routes/"));