Skip to content

Commit

Permalink
pseudo code to reset mime-types and have proper tests - broofa/mime#124
Browse files Browse the repository at this point in the history
  • Loading branch information
dotnetCarpenter committed May 11, 2015
1 parent 303ea14 commit 3fc337b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions lib/ecstatic.js
Expand Up @@ -249,6 +249,9 @@ var ecstatic = module.exports = function (dir, options) {

ecstatic.version = version;
ecstatic.showDir = showDir;
ecstatic.resetMimeTypes = function() {
mime = new mime.Mime();
};

// Check to see if we should try to compress a file with gzip.
function shouldCompress(req) {
Expand Down
5 changes: 3 additions & 2 deletions test/content-type.js
Expand Up @@ -2,10 +2,11 @@
var test = require('tap').test,
http = require('http'),
request = require('request'),
ecstatic;
ecstatic = require('../');

function setup(opts) {
ecstatic = require('../');
// get a fresh ecstatic with a new mime object
ecstatic.resetMimeTypes();
return http.createServer(ecstatic(opts));
}
function teardown(t) {
Expand Down

0 comments on commit 3fc337b

Please sign in to comment.