update verifyHostInputValidity

This commit is contained in:
Maidul Islam
2025-02-27 02:56:28 +09:00
parent 41a3ca149d
commit de420fd02c

View File

@ -24,7 +24,7 @@ export const verifyHostInputValidity = (host: string, isGateway = false) => {
if (
host === "localhost" ||
host === "127.0.0.1" ||
crypto.timingSafeEqual(Buffer.from(dbHost || ""), Buffer.from(host))
(dbHost?.length === host.length && crypto.timingSafeEqual(Buffer.from(dbHost || ""), Buffer.from(host)))
) {
throw new BadRequestError({ message: "Invalid db host" });
}