summary refs log tree commit diff
path: root/src/cdn/routes/external.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/cdn/routes/external.ts')
-rw-r--r--src/cdn/routes/external.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/cdn/routes/external.ts b/src/cdn/routes/external.ts
index 7ccf9b8a..43c4e505 100644
--- a/src/cdn/routes/external.ts
+++ b/src/cdn/routes/external.ts
@@ -19,7 +19,8 @@ const DEFAULT_FETCH_OPTIONS: any = {
 };
 
 router.post("/", async (req: Request, res: Response) => {
-	if (req.headers.signature !== Config.get().security.requestSignature) throw new HTTPError("Invalid request signature");
+	if (req.headers.signature !== Config.get().security.requestSignature)
+		throw new HTTPError(req.t("common:body.INVALID_REQUEST_SIGNATURE"));
 
 	if (!req.body) throw new HTTPError("Invalid Body");
 
@@ -44,7 +45,7 @@ router.get("/:id", async (req: Request, res: Response) => {
 	const { id } = req.params;
 
 	const file = await storage.get(`/external/${id}`);
-	if (!file) throw new HTTPError("File not found");
+	if (!file) throw new HTTPError(req.t("common:notfound.FILE"));
 	const result = await FileType.fromBuffer(file);
 
 	res.set("Content-Type", result?.mime);