Skip to content

Commit dcc3fd7

Browse files
Enhance utility method checking if a user-agent is a bot/spider/crawler
1 parent 3b8f044 commit dcc3fd7

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/util.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ export class UserAgent {
1818

1919
public static isBot(userAgent: string): boolean {
2020
const lowerCaseUserAgent = userAgent.toLowerCase();
21-
return lowerCaseUserAgent.includes('spider') || lowerCaseUserAgent.includes('bot');
21+
22+
return lowerCaseUserAgent.includes('bot') ||
23+
lowerCaseUserAgent.includes('spider') ||
24+
lowerCaseUserAgent.includes('slurp');
2225
}
2326

2427
}

0 commit comments

Comments
 (0)