biggora / express-useragent

NodeJS user-agent middleware
http://www.gordejev.lv
MIT License
644 stars 112 forks source link

visitor with no useragent #121

Open benpptung opened 5 years ago

benpptung commented 5 years ago

Recently, I see some visitors with no useragent found in req.useragent.source, I'm using express-useragent 1.0.12, so I'm wondering what is this? Kind of bot? Or something else?

Thank you for your attention :)

agtom8 commented 2 years ago

I've come across this issue as well. You'd need to either check the source value for undefined before calling the parse method, or modify the latter for handling undefined source to return, say, DefaultAgent object.