Skip to content

Commit 4e5cc1f

Browse files
committed
Fixes handing of no keys set in config
1 parent ea2de87 commit 4e5cc1f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/middlewares.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,9 @@ function handleParseHeaders(req, res, next) {
103103

104104
// We do it with mismatching keys to support no-keys config
105105
var keyMismatch = keys.reduce(function(mismatch, key){
106-
// check the info key
107-
// increment the mismatch if different
108-
if (info[key] !== req.config[key]) {
106+
107+
// check if set in the config and compare
108+
if (req.config[key] && info[key] !== req.config[key]) {
109109
mismatch++;
110110
}
111111
return mismatch;

0 commit comments

Comments
 (0)