Skip to content

Commit

Permalink
fix allowed IP check
Browse files Browse the repository at this point in the history
  • Loading branch information
InventivetalentDev committed Jan 27, 2025
1 parent 203e820 commit 0356537
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/util/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ export async function getAndValidateRequestApiKey(req: MineSkinRequest): Promise
// Either a server IP or a client origin, not both
if (key.allowedIps && key.allowedIps.length > 0) {
const ip = getIp(req);
if (!ip || key.allowedIps.includes(ip.trim())) {
if (!ip || !key.allowedIps.includes(ip.trim())) {
console.log(debug(`Client ${ ip } not allowed`));
throw new MineSkinError("invalid_api_key", "Client not allowed", {httpCode: 403});
}
Expand Down

0 comments on commit 0356537

Please sign in to comment.