diff --git a/jail2ban/__init__.py b/jail2ban/__init__.py index 1716123..dec322c 100644 --- a/jail2ban/__init__.py +++ b/jail2ban/__init__.py @@ -77,7 +77,7 @@ def create_app(): ]) res = pfctl_cfg_write(f'f2b-jail/{remote_user}', b'\n'.join(cfg) + b'\n') - elif request.method == 'DELETE': + else: # 'DELETE': cfg = [cfg_line for cfg_line in cfg if cfg_line.find(bytes(f'', 'ascii')) == -1] res = pfctl_cfg_write(f'f2b-jail/{remote_user}', @@ -110,7 +110,7 @@ def create_app(): table=f'f2b-{name}', operation='add', value=str(ip)) - elif request.method == 'DELETE': + else: # 'DELETE': app.logger.info(f'Remove {ip} from f2b-{name}' f' in anchor f2b-jail/{remote_user}') res = pfctl_table_op(f'f2b-jail/{remote_user}',