Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

ContentType should be case-insensitive. Reference http://www.ietf.org…

…/rfc/rfc2616.txt / 3.7 Media Types
  • Loading branch information...
commit 08863e18eee39afdee687564711dcc3defc724c0 1 parent 783ac17
@phstc phstc authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  lib/node-static.js
View
3  lib/node-static.js
@@ -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] }
Please sign in to comment.
Something went wrong with that request. Please try again.