Skip to content

Commit

Permalink
Run prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
DEVTomatoCake committed Aug 25, 2024
1 parent 1bf2424 commit b73b4e9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/api/middlewares/Authentication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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+)?/;
Expand Down
7 changes: 6 additions & 1 deletion src/api/middlewares/ImageProxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit b73b4e9

Please sign in to comment.