diff --git a/cdn/src/routes/attachments.ts b/cdn/src/routes/attachments.ts
index ae50bc48..33801932 100644
--- a/cdn/src/routes/attachments.ts
+++ b/cdn/src/routes/attachments.ts
@@ -35,8 +35,8 @@ router.post(
Config.get()?.cdn.endpointPublic || "http://localhost:3003";
await storage.set(path, buffer);
- var width;
- var height;
+ let width;
+ let height;
if (mimetype.includes("image")) {
const dimensions = imageSize(buffer);
if (dimensions) {
diff --git a/cdn/src/routes/avatars.ts b/cdn/src/routes/avatars.ts
index 2a4a0ffe..0b766144 100644
--- a/cdn/src/routes/avatars.ts
+++ b/cdn/src/routes/avatars.ts
@@ -33,7 +33,7 @@ router.post(
const { buffer, mimetype, size, originalname, fieldname } = req.file;
const { user_id } = req.params;
- var hash = crypto
+ let hash = crypto
.createHash("md5")
.update(Snowflake.generate())
.digest("hex");
@@ -59,7 +59,7 @@ router.post(
);
router.get("/:user_id", async (req: Request, res: Response) => {
- var { user_id } = req.params;
+ let { user_id } = req.params;
user_id = user_id.split(".")[0]; // remove .file extension
const path = `avatars/${user_id}`;
@@ -74,7 +74,7 @@ router.get("/:user_id", async (req: Request, res: Response) => {
});
router.get("/:user_id/:hash", async (req: Request, res: Response) => {
- var { user_id, hash } = req.params;
+ let { user_id, hash } = req.params;
hash = hash.split(".")[0]; // remove .file extension
const path = `avatars/${user_id}/${hash}`;
diff --git a/cdn/src/routes/role-icons.ts b/cdn/src/routes/role-icons.ts
index 12aae8a4..1d92d638 100644
--- a/cdn/src/routes/role-icons.ts
+++ b/cdn/src/routes/role-icons.ts
@@ -33,7 +33,7 @@ router.post(
const { buffer, mimetype, size, originalname, fieldname } = req.file;
const { role_id } = req.params;
- var hash = crypto
+ let hash = crypto
.createHash("md5")
.update(Snowflake.generate())
.digest("hex");
@@ -58,7 +58,7 @@ router.post(
);
router.get("/:role_id", async (req: Request, res: Response) => {
- var { role_id } = req.params;
+ let { role_id } = req.params;
//role_id = role_id.split(".")[0]; // remove .file extension
const path = `role-icons/${role_id}`;
@@ -73,7 +73,7 @@ router.get("/:role_id", async (req: Request, res: Response) => {
});
router.get("/:role_id/:hash", async (req: Request, res: Response) => {
- var { role_id, hash } = req.params;
+ let { role_id, hash } = req.params;
//hash = hash.split(".")[0]; // remove .file extension
const path = `role-icons/${role_id}/${hash}`;
diff --git a/cdn/src/util/FileStorage.ts b/cdn/src/util/FileStorage.ts
index 84ecf556..376ce007 100644
--- a/cdn/src/util/FileStorage.ts
+++ b/cdn/src/util/FileStorage.ts
@@ -11,7 +11,7 @@ import ExifTransformer = require("exif-be-gone");
function getPath(path: string) {
// STORAGE_LOCATION has a default value in start.ts
const root = process.env.STORAGE_LOCATION || "../";
- var filename = join(root, path);
+ let filename = join(root, path);
if (path.indexOf("\0") !== -1 || !filename.startsWith(root))
throw new Error("invalid path");
|