Skip to content

Commit 88cffad

Browse files
committed
1 parent 3b7ca43 commit 88cffad

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

History.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ unreleased
2222
- Cache URLs based on original value
2323
- Remove no-longer-needed URL mis-parse work-around
2424
- Simplify the "fast-path" `RegExp`
25+
26+
- Add `dotfiles` option
27+
- Cap `maxAge` value to 1 year
28+
29+
2530
* perf: prevent multiple `Buffer` creation in `res.send`
2631

2732
4.6.1 / 2014-07-12

lib/response.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -386,9 +386,6 @@ res.sendfile = function(path, options, fn){
386386
req.socket.removeListener('error', error);
387387
}
388388

389-
// Back-compat
390-
options.maxage = options.maxage || options.maxAge || 0;
391-
392389
// transfer
393390
var file = send(req, path, options);
394391
file.on('error', error);

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"path-to-regexp": "0.1.3",
3939
"proxy-addr": "1.0.1",
4040
"range-parser": "1.0.0",
41-
"send": "0.6.0",
41+
"send": "0.7.0",
4242
"serve-static": "~1.3.2",
4343
"type-is": "~1.3.2",
4444
"vary": "0.1.0",

test/res.sendfile.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ describe('res', function(){
106106
})
107107

108108
describe('.sendfile(path)', function(){
109-
it('should not serve hidden files', function(done){
109+
it('should not serve dotfiles', function(done){
110110
var app = express();
111111

112112
app.use(function(req, res){
@@ -118,11 +118,11 @@ describe('res', function(){
118118
.expect(404, done);
119119
})
120120

121-
it('should accept hidden option', function(done){
121+
it('should accept dotfiles option', function(done){
122122
var app = express();
123123

124124
app.use(function(req, res){
125-
res.sendfile('test/fixtures/.name', { hidden: true });
125+
res.sendfile('test/fixtures/.name', { dotfiles: 'allow' });
126126
});
127127

128128
request(app)

0 commit comments

Comments
 (0)