mape / connect-assetmanager

Middleware for Connect (node.js) for handling your static assets.
MIT License
310 stars 48 forks source link

user agent can be null, causing an error #21

Closed dylang closed 12 years ago

dylang commented 13 years ago

This can be null (from assettmanager.js):

            var userAgent = req.headers['user-agent'];

which results in an error a few lines down:

                    if (!found && userAgent.match(new RegExp(match, 'i'))) {
                                            ^          
                    TypeError: Cannot call method 'match' of undefined

I'm guessing some user with super privacy is hiding his user agent, or some bot.

mape commented 12 years ago

This should have been fixed by commit 8e1be61a9075f54a579f8d489ddede37032ae12b