diff options
author | TheArcaneBrony <myrainbowdash949@gmail.com> | 2022-08-23 19:02:05 +0200 |
---|---|---|
committer | TheArcaneBrony <myrainbowdash949@gmail.com> | 2022-08-23 19:02:05 +0200 |
commit | ba0ba4b61ede1404454b8ab89bd9da61851f8a6e (patch) | |
tree | 254cf1238adea372014b55555e22db6637683d72 /src/cdn/routes/external.ts | |
parent | Merge remote-tracking branch 'Puyodead1/patch/prettier-config' into staging (diff) | |
parent | New db migration script - multiplatform, fix mariadb migrations (diff) | |
download | server-ba0ba4b61ede1404454b8ab89bd9da61851f8a6e.tar.xz |
Merge branch 'dev/cherry-plugins-improvements' into staging
Diffstat (limited to 'src/cdn/routes/external.ts')
-rw-r--r-- | src/cdn/routes/external.ts | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/cdn/routes/external.ts b/src/cdn/routes/external.ts index c9441fc2..7ccf9b8a 100644 --- a/src/cdn/routes/external.ts +++ b/src/cdn/routes/external.ts @@ -1,9 +1,8 @@ -import { Router, Response, Request } from "express"; +import { Config, HTTPError, Snowflake } from "@fosscord/util"; +import { Request, Response, Router } from "express"; +import FileType from "file-type"; import fetch from "node-fetch"; -import { HTTPError } from "@fosscord/util"; -import { Snowflake, Config } from "@fosscord/util"; import { storage } from "../util/Storage"; -import FileType from "file-type"; // TODO: somehow handle the deletion of images posted to the /external route @@ -12,17 +11,15 @@ const DEFAULT_FETCH_OPTIONS: any = { redirect: "follow", follow: 1, headers: { - "user-agent": - "Mozilla/5.0 (compatible Fosscordbot/0.1; +https://fosscord.com)", + "user-agent": "Mozilla/5.0 (compatible Fosscordbot/0.1; +https://fosscord.com)" }, size: 1024 * 1024 * 8, compress: true, - method: "GET", + method: "GET" }; 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("Invalid request signature"); if (!req.body) throw new HTTPError("Invalid Body"); |