Merge branch 'master' into dev

This commit is contained in:
Eric Herbrandson
2020-08-19 09:54:23 -05:00
5 changed files with 124 additions and 4 deletions

View File

@@ -99,9 +99,23 @@ function onError(err, req, res) {
console.log('Error in proxied request', err, req.method, req.url);
}
const SENSITIVE_HEADER_KEYS = ['authorization'];
function scrubHeaders(headers) {
const res = Object.assign({}, headers);
SENSITIVE_HEADER_KEYS.forEach(function(key) {
if (res.hasOwnProperty(key)) {
delete res[key];
}
});
return res;
}
function onProxyRes(proxyRes, req, res) {
console.log('VERBOSE REQUEST', req.method, req.protocol, req.hostname, req.url, req.headers);
console.log('VERBOSE RESPONSE', proxyRes.statusCode, proxyRes.headers);
const reqHeaders = scrubHeaders(req.headers);
console.log('VERBOSE REQUEST', req.method, req.protocol, req.hostname, req.url, reqHeaders);
const proxyResHeaders = scrubHeaders(proxyRes.headers);
console.log('VERBOSE RESPONSE', proxyRes.statusCode, proxyResHeaders);
}
function handleErrors(err, req, res, next) {

View File

@@ -672,6 +672,58 @@
"capture-stack-trace": "^1.0.0"
}
},
"cross-env": {
"version": "7.0.2",
"resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.2.tgz",
"integrity": "sha512-KZP/bMEOJEDCkDQAyRhu3RL2ZO/SUVrxQVI0G3YEQ+OLbRA3c6zgixe8Mq8a/z7+HKlNEjo8oiLUs8iRijY2Rw==",
"dev": true,
"requires": {
"cross-spawn": "^7.0.1"
},
"dependencies": {
"cross-spawn": {
"version": "7.0.3",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
"integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==",
"dev": true,
"requires": {
"path-key": "^3.1.0",
"shebang-command": "^2.0.0",
"which": "^2.0.1"
}
},
"path-key": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz",
"integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==",
"dev": true
},
"shebang-command": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",
"integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==",
"dev": true,
"requires": {
"shebang-regex": "^3.0.0"
}
},
"shebang-regex": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz",
"integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",
"dev": true
},
"which": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
"integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
"dev": true,
"requires": {
"isexe": "^2.0.0"
}
}
}
},
"cross-spawn": {
"version": "5.1.0",
"resolved": "https://nexus.corp.indeed.com/repository/npm/cross-spawn/-/cross-spawn-5.1.0.tgz",

View File

@@ -4,7 +4,7 @@
"description": "",
"main": "index.js",
"scripts": {
"start": "DEBUG_VERBOSE=true nodemon .",
"start": "cross-env DEBUG_VERBOSE=true nodemon .",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
@@ -20,6 +20,7 @@
"stream-to-string": "^1.2.0"
},
"devDependencies": {
"cross-env": "^7.0.2",
"nodemon": "^1.19.4"
}
}