Skip to content

Commit 4a1a5d7

Browse files
committedMay 4, 2017
Add Expect-CT into Helmet 3.6.0
1 parent da74097 commit 4a1a5d7

File tree

5 files changed

+19
-1
lines changed

5 files changed

+19
-1
lines changed
 

‎HISTORY.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
3.6.0 / 2017-05-04
2+
==================
3+
4+
- new: `expectCt` middleware for setting the `Expect-CT` header
5+
16
3.5.0 / 2017-03-06
27
==================
38

‎README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,12 @@ app.use(helmet({
5858
How it works
5959
------------
6060

61-
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.
61+
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.
6262

6363
| Module | Default? |
6464
|---|---|
6565
| [contentSecurityPolicy](https://helmetjs.github.io/docs/csp/) for setting Content Security Policy | |
66+
| [expectCt](https://helmetjs.github.io/docs/expect-ct/) for handling Certificate Transparency | |
6667
| [dnsPrefetchControl](https://helmetjs.github.io/docs/dns-prefetch-control) controls browser DNS prefetching ||
6768
| [frameguard](https://helmetjs.github.io/docs/frameguard/) to prevent clickjacking ||
6869
| [hidePoweredBy](https://helmetjs.github.io/docs/hide-powered-by) to remove the X-Powered-By header ||

‎index.js

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ function helmet (options) {
3131

3232
helmet.contentSecurityPolicy = require('helmet-csp')
3333
helmet.dnsPrefetchControl = require('dns-prefetch-control')
34+
helmet.expectCt = require('expect-ct')
3435
helmet.frameguard = require('frameguard')
3536
helmet.hidePoweredBy = require('hide-powered-by')
3637
helmet.hpkp = require('hpkp')

‎package.json

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"connect": "3.6.0",
3131
"dns-prefetch-control": "0.1.0",
3232
"dont-sniff-mimetype": "1.0.0",
33+
"expect-ct": "0.1.0",
3334
"frameguard": "3.0.0",
3435
"helmet-csp": "2.4.0",
3536
"hide-powered-by": "1.0.0",

‎test/index.js

+10
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ describe('helmet', function () {
2323
assert.equal(helmet.noSniff, pkg)
2424
})
2525

26+
it('aliases "expect-ct"', function () {
27+
var pkg = require('expect-ct')
28+
assert.equal(helmet.expectCt, pkg)
29+
})
30+
2631
it('aliases "frameguard"', function () {
2732
var pkg = require('frameguard')
2833
assert.equal(helmet.frameguard, pkg)
@@ -98,6 +103,7 @@ describe('helmet', function () {
98103
sinon.assert.calledWith(helmet.xssFilter, {})
99104

100105
sinon.assert.notCalled(helmet.contentSecurityPolicy)
106+
sinon.assert.notCalled(helmet.expectCt)
101107
sinon.assert.notCalled(helmet.hpkp)
102108
sinon.assert.notCalled(helmet.noCache)
103109
})
@@ -120,6 +126,7 @@ describe('helmet', function () {
120126
sinon.assert.calledWith(helmet.noSniff, {})
121127
sinon.assert.calledWith(helmet.xssFilter, {})
122128
sinon.assert.notCalled(helmet.contentSecurityPolicy)
129+
sinon.assert.notCalled(helmet.expectCt)
123130
sinon.assert.notCalled(helmet.hpkp)
124131
sinon.assert.notCalled(helmet.noCache)
125132
})
@@ -145,6 +152,7 @@ describe('helmet', function () {
145152
sinon.assert.calledWith(helmet.noSniff, {})
146153
sinon.assert.calledWith(helmet.xssFilter, {})
147154
sinon.assert.notCalled(helmet.contentSecurityPolicy)
155+
sinon.assert.notCalled(helmet.expectCt)
148156
sinon.assert.notCalled(helmet.hpkp)
149157
})
150158

@@ -169,6 +177,7 @@ describe('helmet', function () {
169177
sinon.assert.calledWith(helmet.noSniff, {})
170178
sinon.assert.calledWith(helmet.xssFilter, {})
171179
sinon.assert.notCalled(helmet.contentSecurityPolicy)
180+
sinon.assert.notCalled(helmet.expectCt)
172181
sinon.assert.notCalled(helmet.hpkp)
173182
sinon.assert.notCalled(helmet.noCache)
174183
})
@@ -199,6 +208,7 @@ describe('helmet', function () {
199208
sinon.assert.calledWith(helmet.ieNoOpen, {})
200209
sinon.assert.calledWith(helmet.noSniff, {})
201210
sinon.assert.calledWith(helmet.xssFilter, {})
211+
sinon.assert.notCalled(helmet.expectCt)
202212
sinon.assert.notCalled(helmet.hpkp)
203213
sinon.assert.notCalled(helmet.noCache)
204214
})

0 commit comments

Comments
 (0)
Please sign in to comment.