Skip to content

Commit 59813d2

Browse files
[Security][Clickjacking]-Adding X-Frame-Options and X-Frame-Options header to prevent clickjacking
1 parent 32bc9e4 commit 59813d2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

server.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ app.use((req, res, next) => {
2323
res.header('Strict-Transport-Security', 'max-age=31536000; includeSubDomains; preload');
2424
res.header('Cache-control', 'public, max-age=0');
2525
res.header('Pragma', 'no-cache');
26+
res.setHeader('X-Frame-Options', 'DENY');
27+
res.setHeader('Content-Security-Policy', "frame-ancestors 'none';");
2628

2729
next();
2830
});

0 commit comments

Comments
 (0)