omrilotan / isbot

🤖/👨‍🦰 Detect bots/crawlers/spiders using the user agent string
https://isbot.js.org/
The Unlicense
921 stars 77 forks source link

Accept null in place of userAgent string #235

Closed omrilotan closed 9 months ago

omrilotan commented 9 months ago

I can see it is a common use case to use the headers getter, which makes sense.

With this change, users will be able to remove the check by the user and maintain type compliance. This allows cleaner code for the user.

- isbot(request.headers.get("user-agent") || "")
+ isbot(request.headers.get("user-agent"))