Skip to content

Commit

Permalink
Fixes TypeError: Cannot read property 'range' of undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
choonkeat authored and jfhbrook committed Feb 9, 2014
1 parent 218b644 commit 460f7bd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/ecstatic.js
Expand Up @@ -159,7 +159,7 @@ var ecstatic = module.exports = function (dir, options) {
contentType = mime.lookup(path.basename(file, ".gz"));
}

var range = req.headers['range'];
var range = (req.headers && req.headers['range']);
if (range) {
var total = stat.size;
var parts = range.replace(/bytes=/, "").split("-");
Expand Down

0 comments on commit 460f7bd

Please sign in to comment.