Fix var to avoid pollution

Signed-off-by: Fabio José <fabiojose@gmail.com>
This commit is contained in:
Fabio José 2019-07-16 14:10:07 -03:00
parent aa6881e085
commit 99ac358d11
1 changed files with 5 additions and 5 deletions

View File

@ -84,11 +84,11 @@ Receiver.prototype.check = function(payload, headers) {
}; };
} }
for(i in requiredHeaders){ requiredHeaders
if(!sanityHeaders[requiredHeaders[i]]){ .filter(required => !sanityHeaders[required])
throw {message: "header '" + requiredHeaders[i] + "' not found"}; .forEach(required => {
} throw {message: "header '" + required + "' not found"};
} });
if(sanityHeaders[Constants.BINARY_HEADERS_02.SPEC_VERSION] !== "0.2"){ if(sanityHeaders[Constants.BINARY_HEADERS_02.SPEC_VERSION] !== "0.2"){
throw { throw {