Permalink
Browse files

Merge pull request #54 from phstc/master

ContentType should be case-insensitive.
  • Loading branch information...
2 parents 783ac17 + 08863e1 commit 6a3449b0023c0e418b4bfb78cc2619b2f084d8aa Alexis Sellier committed Jun 27, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/node-static.js
View
@@ -196,8 +196,9 @@ this.Server.prototype.respond = function (pathname, status, _headers, files, sta
} else if (req.method === 'HEAD') {
finish(200, headers);
} else {
+ var fileExtension = path.extname(files[0]).slice(1).toLowerCase();
headers['Content-Length'] = stat.size;
- headers['Content-Type'] = mime.contentTypes[path.extname(files[0]).slice(1)] ||
+ headers['Content-Type'] = mime.contentTypes[fileExtension] ||
'application/octet-stream';
for (var k in _headers) { headers[k] = _headers[k] }

0 comments on commit 6a3449b

Please sign in to comment.