diff --git a/src/core/api.js b/src/core/api.js index c4087e0b..070ff3d6 100644 --- a/src/core/api.js +++ b/src/core/api.js @@ -7,7 +7,7 @@ const ipSalt = randomBytes(64).toString('hex'); import { env, version } from "../modules/config.js"; import match from "../modules/processing/match.js"; import { languageCode } from "../modules/sub/utils.js"; -import { createResponse, verifyRequest, getIP } from "../modules/processing/request.js"; +import { createResponse, normalizeRequest, getIP } from "../modules/processing/request.js"; import { Bright, Cyan } from "../modules/sub/consoleText.js"; import stream from "../modules/stream/stream.js"; import loc from "../localization/manager.js"; @@ -113,7 +113,7 @@ export function runAPI(express, app, gitCommit, gitBranch, __dirname) { } request.dubLang = request.dubLang ? lang : false; - const normalizedRequest = verifyRequest(request); + const normalizedRequest = normalizeRequest(request); if (!normalizedRequest) { return fail('ErrorCantProcess'); } diff --git a/src/modules/processing/request.js b/src/modules/processing/request.js index 1b184bac..f2f58c65 100644 --- a/src/modules/processing/request.js +++ b/src/modules/processing/request.js @@ -101,7 +101,7 @@ export function createResponse(responseType, responseData) { } } -export function verifyRequest(request) { +export function normalizeRequest(request) { try { let template = { url: normalizeURL(decodeURIComponent(request.url)),