express-static-gzip
Advanced tools
Comparing version
@@ -40,3 +40,3 @@ let serveStatic = require('serve-static'); | ||
//test if any compression is available | ||
var matchedFile = files[req.path]; | ||
var matchedFile = files[decodeURIComponent(req.path)]; | ||
if (matchedFile) { | ||
@@ -43,0 +43,0 @@ //as long as there is any compression available for this file, add the Vary Header (used for caching proxies) |
{ | ||
"name": "express-static-gzip", | ||
"version": "1.1.2", | ||
"version": "1.1.3", | ||
"description": "simple wrapper on top of express.static, that allows serving pre-gziped files", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -171,2 +171,11 @@ const expect = require('chai').expect; | ||
it('should handle url encoded path', function(){ | ||
setupServer(); | ||
return requestFile("/filename with spaces.txt", { 'accept-encoding': 'gzip'}).then(resp => { | ||
expect(resp.statusCode).to.equal(200); | ||
expect(resp.body).to.equal('"filename with spaces.txt.gz"'); | ||
}); | ||
}); | ||
/** | ||
@@ -201,2 +210,2 @@ * | ||
} | ||
}); | ||
}); |
30883
1.22%19
5.56%569
1.43%