Skip to content

Commit 9d3ede8

Browse files
Merge pull request #68 from prabalsingh24/api-validator
fix: fix the condition for whitelist_domain api validator
2 parents b030f6e + e7935c2 commit 9d3ede8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/validators/ApiKeyValidators.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export function checkValidApiKey (req: Request): Promise<boolean> {
1919
if (apiKey.whitelist_domains[0] === '*') {
2020
return resolve()
2121
}
22-
if (apiKey.whitelist_domains.indexOf('Referer')) {
22+
if (apiKey.whitelist_domains.indexOf(req.header('Referer')) !== -1) {
2323
return resolve()
2424
}
2525

0 commit comments

Comments
 (0)