Skip to content

Commit 4196458

Browse files
danezdougwilson
authored andcommitted
closes #3431 closes #3435
1 parent ddeb713 commit 4196458

File tree

4 files changed

+25
-2
lines changed

4 files changed

+25
-2
lines changed

History.md

+8
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,14 @@ unreleased
2525
- perf: reduce overhead when no `X-Forwarded-For` header
2626
2727
- Fix parsing & compacting very deep objects
28+
29+
- Add 70 new types for file extensions
30+
- Add `immutable` option
31+
- Fix missing `</html>` in default error & redirects
32+
- Set charset as "UTF-8" for .js and .json
33+
- Use instance methods on steam to check for listeners
34+
35+
- perf: improve path validation speed
2836
2937
3038
* deps: vary@~1.1.2

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"qs": "6.5.1",
5050
"range-parser": "~1.2.0",
5151
"safe-buffer": "5.1.1",
52-
"send": "0.15.6",
52+
"send": "0.16.0",
5353
"serve-static": "1.12.6",
5454
"setprototypeof": "1.1.0",
5555
"statuses": "~1.3.1",

test/res.sendFile.js

+14
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,20 @@ describe('res', function(){
180180
});
181181
});
182182

183+
describe('with "immutable" option', function () {
184+
it('should add immutable cache-control directive', function (done) {
185+
var app = createApp(path.resolve(__dirname, 'fixtures/name.txt'), {
186+
immutable: true,
187+
maxAge: '4h'
188+
})
189+
190+
request(app)
191+
.get('/')
192+
.expect('Cache-Control', 'public, max-age=14400, immutable')
193+
.expect(200, done)
194+
})
195+
})
196+
183197
describe('with "maxAge" option', function () {
184198
it('should set cache-control max-age from number', function (done) {
185199
var app = createApp(path.resolve(__dirname, 'fixtures/name.txt'), {

test/res.type.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ describe('res', function(){
1313

1414
request(app)
1515
.get('/')
16-
.expect('Content-Type', 'application/javascript', done);
16+
.expect('Content-Type', 'application/javascript; charset=utf-8')
17+
.end(done)
1718
})
1819

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

0 commit comments

Comments
 (0)