Open Grant-Lay opened 4 years ago
I think this is actually affecting all known bots, https://github.com/biggora/express-useragent/blob/master/lib/express-useragent.js#L806 the function returns the second item in the array from regex exec
function which is either a string or null. I can see postman
also returns a string for example.
Workaround: Use string type in the application and cast the result to the string by request.useragent.isBot.toString() This works fine in my typescript project.
isBot returns false when the user agent is not a bot but returns 'google' when using the google bot user agent. Should it not display true instead and then have a separate property botType which returns google?