Permalink
Browse files

Implemented actual patch for defaultContentType.

  • Loading branch information...
jprichardson committed Sep 20, 2012
1 parent 5336e21 commit 4575036b3de317e2bb1f4f69811c34d27c50d556
Showing with 5 additions and 0 deletions.
  1. +4 −0 lib/file.js
  2. +1 −0 lib/index.js
View
@@ -8,6 +8,7 @@ var fs = require('fs')
, pkgInfo = require('../package.json')
, poweredBy = pkgInfo.name + ' ' + pkgInfo.version
, gzippable = require('./gzippable')
+ , path = require('path')
;
function File(file, options) {
@@ -17,6 +18,9 @@ function File(file, options) {
this.keepAlive = this.options.keepAlive && Math.round(this.options.keepAlive / 1000);
this.file = file;
this.mime = mime.lookup(this.file);
+ if (path.extname(file) === '') {
+ this.mime = options.defaultContentType;
+ }
this.cache();
}
inherits(File, EventEmitter);
View
@@ -19,6 +19,7 @@ module.exports = function buffet(root, opts) {
options[opt] = true;
}
});
+ options.defaultContentType = options.defaultContentType || 'application/octet-stream';
if (typeof options.keepAlive === 'undefined') {
options.keepAlive = 5000;
}

0 comments on commit 4575036

Please sign in to comment.