Skip to content

Commit

Permalink
Add Expect-CT into Helmet 3.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
EvanHahn committed May 4, 2017
1 parent da74097 commit 4a1a5d7
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 1 deletion.
5 changes: 5 additions & 0 deletions HISTORY.md
@@ -1,3 +1,8 @@
3.6.0 / 2017-05-04
==================

- new: `expectCt` middleware for setting the `Expect-CT` header

3.5.0 / 2017-03-06
==================

Expand Down
3 changes: 2 additions & 1 deletion README.md
Expand Up @@ -58,11 +58,12 @@ app.use(helmet({
How it works
------------

Helmet is a collection of 11 smaller middleware functions that set HTTP headers. Running `app.use(helmet())` will not include all of these middleware functions by default.
Helmet is a collection of 12 smaller middleware functions that set HTTP headers. Running `app.use(helmet())` will not include all of these middleware functions by default.

| Module | Default? |
|---|---|
| [contentSecurityPolicy](https://helmetjs.github.io/docs/csp/) for setting Content Security Policy | |
| [expectCt](https://helmetjs.github.io/docs/expect-ct/) for handling Certificate Transparency | |
| [dnsPrefetchControl](https://helmetjs.github.io/docs/dns-prefetch-control) controls browser DNS prefetching ||
| [frameguard](https://helmetjs.github.io/docs/frameguard/) to prevent clickjacking ||
| [hidePoweredBy](https://helmetjs.github.io/docs/hide-powered-by) to remove the X-Powered-By header ||
Expand Down
1 change: 1 addition & 0 deletions index.js
Expand Up @@ -31,6 +31,7 @@ function helmet (options) {

helmet.contentSecurityPolicy = require('helmet-csp')
helmet.dnsPrefetchControl = require('dns-prefetch-control')
helmet.expectCt = require('expect-ct')
helmet.frameguard = require('frameguard')
helmet.hidePoweredBy = require('hide-powered-by')
helmet.hpkp = require('hpkp')
Expand Down
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -30,6 +30,7 @@
"connect": "3.6.0",
"dns-prefetch-control": "0.1.0",
"dont-sniff-mimetype": "1.0.0",
"expect-ct": "0.1.0",
"frameguard": "3.0.0",
"helmet-csp": "2.4.0",
"hide-powered-by": "1.0.0",
Expand Down
10 changes: 10 additions & 0 deletions test/index.js
Expand Up @@ -23,6 +23,11 @@ describe('helmet', function () {
assert.equal(helmet.noSniff, pkg)
})

it('aliases "expect-ct"', function () {
var pkg = require('expect-ct')
assert.equal(helmet.expectCt, pkg)
})

it('aliases "frameguard"', function () {
var pkg = require('frameguard')
assert.equal(helmet.frameguard, pkg)
Expand Down Expand Up @@ -98,6 +103,7 @@ describe('helmet', function () {
sinon.assert.calledWith(helmet.xssFilter, {})

sinon.assert.notCalled(helmet.contentSecurityPolicy)
sinon.assert.notCalled(helmet.expectCt)
sinon.assert.notCalled(helmet.hpkp)
sinon.assert.notCalled(helmet.noCache)
})
Expand All @@ -120,6 +126,7 @@ describe('helmet', function () {
sinon.assert.calledWith(helmet.noSniff, {})
sinon.assert.calledWith(helmet.xssFilter, {})
sinon.assert.notCalled(helmet.contentSecurityPolicy)
sinon.assert.notCalled(helmet.expectCt)
sinon.assert.notCalled(helmet.hpkp)
sinon.assert.notCalled(helmet.noCache)
})
Expand All @@ -145,6 +152,7 @@ describe('helmet', function () {
sinon.assert.calledWith(helmet.noSniff, {})
sinon.assert.calledWith(helmet.xssFilter, {})
sinon.assert.notCalled(helmet.contentSecurityPolicy)
sinon.assert.notCalled(helmet.expectCt)
sinon.assert.notCalled(helmet.hpkp)
})

Expand All @@ -169,6 +177,7 @@ describe('helmet', function () {
sinon.assert.calledWith(helmet.noSniff, {})
sinon.assert.calledWith(helmet.xssFilter, {})
sinon.assert.notCalled(helmet.contentSecurityPolicy)
sinon.assert.notCalled(helmet.expectCt)
sinon.assert.notCalled(helmet.hpkp)
sinon.assert.notCalled(helmet.noCache)
})
Expand Down Expand Up @@ -199,6 +208,7 @@ describe('helmet', function () {
sinon.assert.calledWith(helmet.ieNoOpen, {})
sinon.assert.calledWith(helmet.noSniff, {})
sinon.assert.calledWith(helmet.xssFilter, {})
sinon.assert.notCalled(helmet.expectCt)
sinon.assert.notCalled(helmet.hpkp)
sinon.assert.notCalled(helmet.noCache)
})
Expand Down

0 comments on commit 4a1a5d7

Please sign in to comment.