Browse Source

fix: source & destination are required

pull/1210/head
tetuaoro 2 years ago
parent
commit
075d23089e
  1. 11
      src/lib/Firewall.js

11
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)
}
/*

Loading…
Cancel
Save