From 1c8232d1ecd728faae58a27f4e1ef34c23be68f5 Mon Sep 17 00:00:00 2001 From: Overtorment Date: Mon, 21 Jun 2021 12:29:13 +0100 Subject: [PATCH] FIX: hsts header --- index.js | 3 +++ package-lock.json | 5 +++++ package.json | 1 + scripts/important-channels.js | 4 ++-- 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 527d9a1..91953aa 100644 --- a/index.js +++ b/index.js @@ -5,6 +5,7 @@ process.on('uncaughtException', function (err) { process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'; let express = require('express'); +const helmet = require('helmet'); let morgan = require('morgan'); import { v4 as uuidv4 } from 'uuid'; let logger = require('./utils/logger'); @@ -16,6 +17,8 @@ morgan.token('id', function getId(req) { let app = express(); app.enable('trust proxy'); +app.use(helmet.hsts()); +app.use(helmet.hidePoweredBy()); const rateLimit = require('express-rate-limit'); const limiter = rateLimit({ diff --git a/package-lock.json b/package-lock.json index 9170a50..47e00ef 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3460,6 +3460,11 @@ "minimalistic-assert": "^1.0.1" } }, + "helmet": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/helmet/-/helmet-4.6.0.tgz", + "integrity": "sha512-HVqALKZlR95ROkrnesdhbbZJFi/rIVSoNq6f3jA/9u6MIbTsPh3xZwihjeI5+DO/2sOV6HMHooXcEOuwskHpTg==" + }, "hmac-drbg": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", diff --git a/package.json b/package.json index 22f72c6..b92a93c 100644 --- a/package.json +++ b/package.json @@ -30,6 +30,7 @@ "express": "^4.17.1", "express-rate-limit": "^5.2.6", "frisbee": "^3.1.4", + "helmet": "^4.6.0", "ioredis": "^4.27.2", "jayson": "^3.6.3", "morgan": "^1.10.0", diff --git a/scripts/important-channels.js b/scripts/important-channels.js index 7bc51b2..7eddf40 100644 --- a/scripts/important-channels.js +++ b/scripts/important-channels.js @@ -45,9 +45,9 @@ const important_channels = { uri: '02816caed43171d3c9854e3b0ab2cf0c42be086ff1bd4005acc2a5f7db70d83774@35.238.153.25:9735', wumbo: 1, }, - '02570432c30df86ff7dbe3b49e24e8280411674f96470154cadc76d447e339292b': { + '036b53093df5a932deac828cca6d663472dbc88322b05eec1d42b26ab9b16caa1c': { name: 'okcoin', - uri: '02570432c30df86ff7dbe3b49e24e8280411674f96470154cadc76d447e339292b@8.210.75.128:26657', + uri: '036b53093df5a932deac828cca6d663472dbc88322b05eec1d42b26ab9b16caa1c@47.243.25.4:26658', wumbo: 1, }, // '0331f80652fb840239df8dc99205792bba2e559a05469915804c08420230e23c7c': {