Skip to content

Commit

Permalink
deps: send@0.16.0
Browse files Browse the repository at this point in the history
closes #3431
closes #3435
  • Loading branch information
danez authored and dougwilson committed Sep 28, 2017
1 parent ddeb713 commit 4196458
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 2 deletions.
8 changes: 8 additions & 0 deletions History.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ unreleased
- perf: reduce overhead when no `X-Forwarded-For` header
* deps: qs@6.5.1
- Fix parsing & compacting very deep objects
* deps: send@0.16.0
- Add 70 new types for file extensions
- Add `immutable` option
- Fix missing `</html>` in default error & redirects
- Set charset as "UTF-8" for .js and .json
- Use instance methods on steam to check for listeners
- deps: mime@1.4.1
- perf: improve path validation speed
* deps: setprototypeof@1.1.0
* deps: utils-merge@1.0.1
* deps: vary@~1.1.2
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"qs": "6.5.1",
"range-parser": "~1.2.0",
"safe-buffer": "5.1.1",
"send": "0.15.6",
"send": "0.16.0",
"serve-static": "1.12.6",
"setprototypeof": "1.1.0",
"statuses": "~1.3.1",
Expand Down
14 changes: 14 additions & 0 deletions test/res.sendFile.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,20 @@ describe('res', function(){
});
});

describe('with "immutable" option', function () {
it('should add immutable cache-control directive', function (done) {
var app = createApp(path.resolve(__dirname, 'fixtures/name.txt'), {
immutable: true,
maxAge: '4h'
})

request(app)
.get('/')
.expect('Cache-Control', 'public, max-age=14400, immutable')
.expect(200, done)
})
})

describe('with "maxAge" option', function () {
it('should set cache-control max-age from number', function (done) {
var app = createApp(path.resolve(__dirname, 'fixtures/name.txt'), {
Expand Down
3 changes: 2 additions & 1 deletion test/res.type.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ describe('res', function(){

request(app)
.get('/')
.expect('Content-Type', 'application/javascript', done);
.expect('Content-Type', 'application/javascript; charset=utf-8')
.end(done)
})

it('should default to application/octet-stream', function(done){
Expand Down

0 comments on commit 4196458

Please sign in to comment.