We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f520e00 commit 29660d9Copy full SHA for 29660d9
src/middleware/userCounter.ts
@@ -6,8 +6,10 @@ import { getHash } from "../utils/getHash";
6
import { NextFunction, Request, Response } from "express";
7
8
export function userCounter(req: Request, res: Response, next: NextFunction): void {
9
- axios.post(`${config.userCounterURL}/api/v1/addIP?hashedIP=${getHash(getIP(req), 1)}`)
10
- .catch(() => Logger.debug(`Failing to connect to user counter at: ${config.userCounterURL}`));
+ if (req.method !== "OPTIONS") {
+ axios.post(`${config.userCounterURL}/api/v1/addIP?hashedIP=${getHash(getIP(req), 1)}`)
11
+ .catch(() => Logger.debug(`Failing to connect to user counter at: ${config.userCounterURL}`));
12
+ }
13
14
next();
15
}
0 commit comments