Skip to content

Commit e7935c2

Browse files
committed
fix: fix the condition for whitelist_domain api validator
1 parent 72944d1 commit e7935c2

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)