Skip to content

Commit

Permalink
deps: send@0.16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dougwilson committed Sep 28, 2017
1 parent 843d1ea commit d9c5e27
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 2 deletions.
12 changes: 12 additions & 0 deletions HISTORY.md
@@ -1,3 +1,15 @@
unreleased
==========

* 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

1.12.6 / 2017-09-22
===================

Expand Down
10 changes: 9 additions & 1 deletion README.md
Expand Up @@ -44,7 +44,7 @@ of the `Range` request header.
##### cacheControl

Enable or disable setting `Cache-Control` response header, defaults to
true. Disabling this will ignore the `maxAge` option.
true. Disabling this will ignore the `immutable` and `maxAge` options.

##### dotfiles

Expand Down Expand Up @@ -93,6 +93,14 @@ all methods.

The default value is `true`.

##### immutable

Enable or diable the `immutable` directive in the `Cache-Control` response
header, defaults to `false`. If set to `true`, the `maxAge` option should
also be specified to enable caching. The `immutable` directive will prevent
supported clients from making conditional requests during the life of the
`maxAge` option to check if the file has changed.

##### index

By default this module will send "index.html" files in response to a request
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -9,7 +9,7 @@
"encodeurl": "~1.0.1",
"escape-html": "~1.0.3",
"parseurl": "~1.3.2",
"send": "0.15.6"
"send": "0.16.0"
},
"devDependencies": {
"eslint": "3.19.0",
Expand Down
14 changes: 14 additions & 0 deletions test/test.js
Expand Up @@ -403,6 +403,20 @@ describe('serveStatic()', function () {
})
})

describe('immutable', function () {
it('should default to false', function (done) {
request(createServer(fixtures))
.get('/nums')
.expect('Cache-Control', 'public, max-age=0', done)
})

it('should set immutable directive in Cache-Control', function (done) {
request(createServer(fixtures, {'immutable': true, 'maxAge': '1h'}))
.get('/nums')
.expect('Cache-Control', 'public, max-age=3600, immutable', done)
})
})

describe('lastModified', function () {
describe('when false', function () {
it('should not include Last-Modifed', function (done) {
Expand Down

0 comments on commit d9c5e27

Please sign in to comment.