Skip to content

Commit

Permalink
fix: remove CSP middleware, doesn't make sense for an API
Browse files Browse the repository at this point in the history
  • Loading branch information
davewasmer committed Mar 5, 2017
1 parent c782dd6 commit aa1e0cc
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions config/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,19 +65,6 @@ export default function baseMiddleware(router: Router, application: Application)
router.use(cors(config.cors));
}

if (isEnabled('csp')) {
let cspConfig: any = defaultsDeep<{ [key: string]: any }, { [key: string]: any }>(config.csp, {
directives: { reportUri: '/_report-csp-violations' },
reportOnly: application.environment === 'development',
disableAndroid: true
});
router.use(helmet.contentSecurityPolicy(cspConfig));
if (config.csp && config.csp.useDummyReportingEndpoint) {
// TODO create an action in the app/ dir to handle this (allows for user overrides then too)
// router.post(cspConfig.directives.reportUri, (req: IncomingMessage, res: ServerResponse) => res.sendStatus(200));
}
}

if (isEnabled('xssFilter')) {
router.use(helmet.xssFilter());
}
Expand Down

0 comments on commit aa1e0cc

Please sign in to comment.