mirror of
https://github.com/vitodeploy/vito.git
synced 2025-04-19 09:51:37 +00:00
make mask nullable and do a strict compare to allow firwall rules without masks (#432)
This commit is contained in:
parent
a0940d4581
commit
93a7bf9c3a
@ -59,7 +59,7 @@ public static function rules(): array
|
||||
'ip',
|
||||
],
|
||||
'mask' => [
|
||||
'required',
|
||||
'nullable',
|
||||
'numeric',
|
||||
],
|
||||
];
|
||||
|
@ -30,7 +30,7 @@ public function addRule(string $type, string $protocol, int $port, string $sourc
|
||||
'protocol' => $protocol,
|
||||
'port' => $port,
|
||||
'source' => $source,
|
||||
'mask' => $mask || $mask == 0 ? '/'.$mask : '',
|
||||
'mask' => $mask || $mask === 0 ? '/'.$mask : '',
|
||||
]),
|
||||
'add-firewall-rule'
|
||||
);
|
||||
@ -44,7 +44,7 @@ public function removeRule(string $type, string $protocol, int $port, string $so
|
||||
'protocol' => $protocol,
|
||||
'port' => $port,
|
||||
'source' => $source,
|
||||
'mask' => $mask || $mask == 0 ? '/'.$mask : '',
|
||||
'mask' => $mask || $mask === 0 ? '/'.$mask : '',
|
||||
]),
|
||||
'remove-firewall-rule'
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user