From e56b36c158d98baea1dc0ec74a600d0fb5f4f01c Mon Sep 17 00:00:00 2001 From: Rui Saraiva Date: Sun, 12 Dec 2021 22:07:05 +0000 Subject: [PATCH] feat: add security headers --- next.config.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/next.config.js b/next.config.js index 8fc8447..5eab9e5 100644 --- a/next.config.js +++ b/next.config.js @@ -4,4 +4,29 @@ module.exports = { deviceSizes: [375, 750, 1125], imageSizes: [56, 112, 185, 370, 370, 375, 540, 740, 750, 1080], }, + headers() { + return [ + { + source: '/(.*)', + headers: [ + { + key: 'X-XSS-Protection', + value: '1; mode=block', + }, + { + key: 'X-Frame-Options', + value: 'SAMEORIGIN', + }, + { + key: 'X-Content-Type-Options', + value: 'nosniff', + }, + { + key: 'Content-Security-Policy', + value: `default-src 'self'; frame-ancestors 'self'`, + }, + ], + }, + ] + }, }