Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

pass default content type to mime.lookup()

  • Loading branch information...
commit 767d622a87e7a20fe1768c5f3a1029412f6ffa18 1 parent 505d5ad
Carlos Rodriguez authored

Showing 1 changed file with 1 addition and 6 deletions. Show diff stats Hide diff stats

  1. 7  lib/file.js
7  lib/file.js
@@ -8,8 +8,6 @@ var fs = require('fs')
8 8
   , pkgInfo = require('../package.json')
9 9
   , poweredBy = pkgInfo.name + ' ' + pkgInfo.version
10 10
   , gzippable = require('./gzippable')
11  
-  , path = require('path')
12  
-  ;
13 11
 
14 12
 function File(file, options) {
15 13
   EventEmitter.call(this);
@@ -17,10 +15,7 @@ function File(file, options) {
17 15
   this.options = copy(options);
18 16
   this.keepAlive = this.options.keepAlive && Math.round(this.options.keepAlive / 1000);
19 17
   this.file = file;
20  
-  this.mime = mime.lookup(this.file);
21  
-  if (path.extname(file) === '') {
22  
-    this.mime = options.defaultContentType;
23  
-  }
  18
+  this.mime = mime.lookup(this.file, options.defaultContentType);
24 19
   this.cache();
25 20
 }
26 21
 inherits(File, EventEmitter);

0 notes on commit 767d622

Please sign in to comment.
Something went wrong with that request. Please try again.