File tree Expand file tree Collapse file tree 4 files changed +8784
-1
lines changed Expand file tree Collapse file tree 4 files changed +8784
-1
lines changed Original file line number Diff line number Diff line change @@ -5,3 +5,4 @@ node_modules
55coverage
66.nyc_output
77locales
8+ package-lock.json
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ const conditional = require('koa-conditional-get');
1717const cors = require ( 'kcors' ) ;
1818const errorHandler = require ( 'koa-better-error-handler' ) ;
1919const etag = require ( 'koa-etag' ) ;
20+ const expectCt = require ( 'koa-expect-ct' ) ;
2021const helmet = require ( 'koa-helmet' ) ;
2122const json = require ( 'koa-json' ) ;
2223const koa404Handler = require ( 'koa-404-handler' ) ;
@@ -125,7 +126,10 @@ class API {
125126 if ( this . config . cors ) app . use ( cors ( this . config . cors ) ) ;
126127
127128 // security
128- app . use ( helmet ( ) ) ;
129+ if ( this . config . helmet ) app . use ( helmet ( this . config . helmet ) ) ;
130+
131+ // add Expect-CT header for cert transparency
132+ if ( this . config . expectCT ) app . use ( expectCt ( this . config . expectCT ) ) ;
129133
130134 // remove trailing slashes
131135 app . use ( removeTrailingSlashes ( ) ) ;
Original file line number Diff line number Diff line change 3939 "koa-conditional-get" : " ^2.0.0" ,
4040 "koa-connect" : " ^2.0.1" ,
4141 "koa-etag" : " ^3.0.0" ,
42+ "koa-expect-ct" : " ^0.0.1" ,
4243 "koa-helmet" : " ^5.2.0" ,
4344 "koa-json" : " ^2.0.2" ,
4445 "koa-no-trailing-slash" : " ^2.1.0" ,
You can’t perform that action at this time.
0 commit comments