mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-16 08:26:59 +03:00
fix eslint-errors
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import {NextFunction, Request, Response} from 'express';
|
||||
|
||||
export function apiCspMiddleware(req: Request, res: Response, next: NextFunction) {
|
||||
export function apiCspMiddleware(req: Request, res: Response, next: NextFunction): void {
|
||||
res.header("Content-Security-Policy", "script-src 'none'; object-src 'none'");
|
||||
next();
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
import {NextFunction, Request, Response} from 'express';
|
||||
|
||||
export function corsMiddleware(req: Request, res: Response, next: NextFunction) {
|
||||
export function corsMiddleware(req: Request, res: Response, next: NextFunction): void {
|
||||
res.header("Access-Control-Allow-Origin", "*");
|
||||
res.header("Access-Control-Allow-Headers", "X-Requested-With, Content-Type, Accept");
|
||||
res.header("Access-Control-Allow-Methods", "GET, POST, OPTIONS, DELETE")
|
||||
res.header("Access-Control-Allow-Methods", "GET, POST, OPTIONS, DELETE");
|
||||
next();
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import {Logger} from '../utils/logger';
|
||||
import {NextFunction, Request, Response} from 'express';
|
||||
|
||||
export function loggerMiddleware(req: Request, res: Response, next: NextFunction) {
|
||||
export function loggerMiddleware(req: Request, res: Response, next: NextFunction): void {
|
||||
Logger.info(`Request received: ${req.method} ${req.url}`);
|
||||
next();
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import {getIP} from '../utils/getIP';
|
||||
import {getHash} from '../utils/getHash';
|
||||
import {NextFunction, Request, Response} from 'express';
|
||||
|
||||
export function userCounter(req: Request, res: Response, next: NextFunction) {
|
||||
export function userCounter(req: Request, res: Response, next: NextFunction): void {
|
||||
fetch(config.userCounterURL + "/api/v1/addIP?hashedIP=" + getHash(getIP(req), 1), {method: "POST"})
|
||||
.catch(() => Logger.debug("Failing to connect to user counter at: " + config.userCounterURL));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user