mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-17 03:44:20 +03:00
everything to postClearCache
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import fetch from "node-fetch";
|
||||
import axios from "axios";
|
||||
import {Logger} from "../utils/logger";
|
||||
import {config} from "../config";
|
||||
import {getIP} from "../utils/getIP";
|
||||
@@ -6,7 +6,7 @@ import {getHash} from "../utils/getHash";
|
||||
import {NextFunction, Request, Response} from "express";
|
||||
|
||||
export function userCounter(req: Request, res: Response, next: NextFunction): void {
|
||||
fetch(`${config.userCounterURL}/api/v1/addIP?hashedIP=${getHash(getIP(req), 1)}`, {method: "POST"})
|
||||
axios.post(`${config.userCounterURL}/api/v1/addIP?hashedIP=${getHash(getIP(req), 1)}`)
|
||||
.catch(() => Logger.debug(`Failing to connect to user counter at: ${config.userCounterURL}`));
|
||||
|
||||
next();
|
||||
|
||||
Reference in New Issue
Block a user