diff --git a/src/lib/Firewall.js b/src/lib/Firewall.js index 61057bea..41b51426 100644 --- a/src/lib/Firewall.js +++ b/src/lib/Firewall.js @@ -99,6 +99,7 @@ module.exports = class Firewall { async addIptablesRule(source, destination, protocol, target) { debug('Rule adding...'); +<<<<<<< HEAD <<<<<<< HEAD // Validate target & protocol if (!Util.isTarget(target) || !Util.isProtocol(protocol)) { @@ -156,6 +157,16 @@ module.exports = class Firewall { // Validate protocol if (!Util.isValidIptablesProtocol(protocol)) { throw new Error('Invalid protocol.'); +======= + // Validate target & protocol + if (!Util.isValidIptablesTarget(target) || !Util.isValidIptablesProtocol(protocol)) { + throw new Error('Invalid target or protocol.'); + } + + // If empty source or destination + if (!source || !destination) { + throw new Error('Invalid source or destination address.') +>>>>>>> a20e416 (fix: source & destination are required) } /*