Skip to content

Commit

Permalink
Handle missing User-Agent
Browse files Browse the repository at this point in the history
Fixes #17.

Repro: curl -H 'User-Agent:' $URL to something serving an asset.
  • Loading branch information
daaku committed Nov 10, 2011
1 parent b3b29e5 commit 8e1be61
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/assetmanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ module.exports = function assetManager (settings) {
var groupServed;
settings.forEach(function (group, groupName) {
if (group.route.test(req.url)) {
var userAgent = req.headers['user-agent'];
var userAgent = req.headers['user-agent'] || '';
groupServed = group;
if (group.dataType === 'javascript') {
mimeType = 'application/javascript';
Expand Down

0 comments on commit 8e1be61

Please sign in to comment.