Skip to content

Commit 1590c03

Browse files
committed
Merge branch 'master' of github.com:je-poy/UrlCompressor-Server into testing
2 parents f0bc197 + 08f58dc commit 1590c03

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

app.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
const express = require("express");
22
const mongoose = require("mongoose");
33
const bodyParser = require("body-parser");
4+
const helmet = require("helmet");
45
const cors = require("cors");
56

67
const url = require("./routes/api/url");
@@ -11,6 +12,14 @@ const Url = require("./models/url");
1112

1213
const app = express();
1314

15+
app.use(helmet.permittedCrossDomainPolicies());
16+
app.use(helmet.xssFilter());
17+
18+
app.use(helmet.dnsPrefetchControl({ allow: true }));
19+
app.use(helmet.frameguard({ action: 'sameorigin' }));
20+
app.use(helmet.hidePoweredBy({ setTo: 'your dummy tech' }));
21+
app.use(helmet.hsts({ maxAge: 2592000 })); //30 days max age
22+
1423
app.use(bodyParser.urlencoded({ extended: false }));
1524
app.use(bodyParser.json());
1625
app.use(cors());

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"body-parser": "^1.19.0",
1616
"cors": "^2.8.5",
1717
"express": "^4.17.1",
18+
"helmet": "^4.1.1",
1819
"jsonwebtoken": "^8.5.1",
1920
"mongoose": "^5.9.15",
2021
"shortid": "^2.2.15",

0 commit comments

Comments
 (0)