summary refs log tree commit diff
path: root/src/api
diff options
context:
space:
mode:
authorTomatoCake <60300461+DEVTomatoCake@users.noreply.github.com>2024-08-25 06:51:30 +0200
committerTomatoCake <60300461+DEVTomatoCake@users.noreply.github.com>2024-08-25 06:51:30 +0200
commitb73b4e95028d6bfda21ed206db30084b5f1085d3 (patch)
tree3907f0ca1a2cc9fdd047c61aec165edd0a3b5eb4 /src/api
parentRemove auth requirement & fix image path (diff)
downloadserver-ts-b73b4e95028d6bfda21ed206db30084b5f1085d3.tar.xz
Run prettier
Diffstat (limited to 'src/api')
-rw-r--r--src/api/middlewares/Authentication.ts2
-rw-r--r--src/api/middlewares/ImageProxy.ts7
2 files changed, 7 insertions, 2 deletions
diff --git a/src/api/middlewares/Authentication.ts b/src/api/middlewares/Authentication.ts

index 187859085..ec77cbbb8 100644 --- a/src/api/middlewares/Authentication.ts +++ b/src/api/middlewares/Authentication.ts
@@ -55,7 +55,7 @@ export const NO_AUTHORIZATION_ROUTES = [ // Connections /POST \/connections\/\w+\/callback/, // Image proxy - /GET \/imageproxy\/[A-Za-z0-9+/]\/\d+x\d+\/.+/ + /GET \/imageproxy\/[A-Za-z0-9+/]\/\d+x\d+\/.+/, ]; export const API_PREFIX = /^\/api(\/v\d+)?/; diff --git a/src/api/middlewares/ImageProxy.ts b/src/api/middlewares/ImageProxy.ts
index d1d0faa79..4f9eef10c 100644 --- a/src/api/middlewares/ImageProxy.ts +++ b/src/api/middlewares/ImageProxy.ts
@@ -67,7 +67,12 @@ export async function ImageProxy(req: Request, res: Response) { if (!crypto.timingSafeEqual(Buffer.from(hash), Buffer.from(path[0]))) throw new Error("Invalid signature"); } catch { - console.log("[ImageProxy] Invalid signature, expected " + hash + " but got " + path[0]); + console.log( + "[ImageProxy] Invalid signature, expected " + + hash + + " but got " + + path[0], + ); res.status(403).send("Invalid signature"); return; }