|
@ -7,6 +7,7 @@ |
|
|
const { App } = require('@tinyhttp/app') |
|
|
const { App } = require('@tinyhttp/app') |
|
|
const sirv = require('sirv') |
|
|
const sirv = require('sirv') |
|
|
const helmet = require('helmet') |
|
|
const helmet = require('helmet') |
|
|
|
|
|
const nocache = require('nocache') |
|
|
const Logger = require('../logger') |
|
|
const Logger = require('../logger') |
|
|
const errors = require('../errors'); |
|
|
const errors = require('../errors'); |
|
|
|
|
|
|
|
@ -48,6 +49,7 @@ class HttpServer { |
|
|
this.app.use(HttpServer.requestLogger) |
|
|
this.app.use(HttpServer.requestLogger) |
|
|
this.app.use(HttpServer.setCrossOrigin) |
|
|
this.app.use(HttpServer.setCrossOrigin) |
|
|
this.app.use(helmet(HttpServer.HELMET_POLICY)) |
|
|
this.app.use(helmet(HttpServer.HELMET_POLICY)) |
|
|
|
|
|
this.app.use(nocache()) |
|
|
|
|
|
|
|
|
this.app.use('/static', sirv('../static')); |
|
|
this.app.use('/static', sirv('../static')); |
|
|
|
|
|
|
|
@ -218,16 +220,11 @@ HttpServer.HELMET_POLICY = { |
|
|
'style-src': ["'self'", "https:", "'unsafe-inline'"], |
|
|
'style-src': ["'self'", "https:", "'unsafe-inline'"], |
|
|
'media-src': ["'self'", 'data:'], |
|
|
'media-src': ["'self'", 'data:'], |
|
|
}, |
|
|
}, |
|
|
'browserSniff': false, |
|
|
|
|
|
'disableAndroid': true |
|
|
|
|
|
}, |
|
|
}, |
|
|
'dnsPrefetchControl': true, |
|
|
'dnsPrefetchControl': true, |
|
|
'frameguard': true, |
|
|
'frameguard': true, |
|
|
'hidePoweredBy': true, |
|
|
'hidePoweredBy': true, |
|
|
'hpkp': false, |
|
|
|
|
|
'hsts': true, |
|
|
|
|
|
'ieNoOpen': true, |
|
|
'ieNoOpen': true, |
|
|
'noCache': true, |
|
|
|
|
|
'noSniff': true, |
|
|
'noSniff': true, |
|
|
'referrerPolicy': true, |
|
|
'referrerPolicy': true, |
|
|
'xssFilter': true |
|
|
'xssFilter': true |
|
|