From 2cf7bb6cb390df92ddc89f21d95040e20c10bb75 Mon Sep 17 00:00:00 2001 From: ReturnFI <151555003+ReturnFI@users.noreply.github.com> Date: Wed, 29 Oct 2025 19:58:57 +0000 Subject: [PATCH] Removed the input validation check --- core/cli_api.py | 4 ++-- core/scripts/webpanel/routers/api/v1/config/ip.py | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/core/cli_api.py b/core/cli_api.py index 0baf749..729898e 100644 --- a/core/cli_api.py +++ b/core/cli_api.py @@ -465,8 +465,8 @@ def edit_ip_address(ipv4: str, ipv6: str): :raises InvalidInputError: If neither ipv4 nor ipv6 is provided. ''' - if not ipv4 and not ipv6: - raise InvalidInputError('Error: --edit requires at least one of --ipv4 or --ipv6.') + # if not ipv4 and not ipv6: + # raise InvalidInputError('Error: --edit requires at least one of --ipv4 or --ipv6.') if ipv4: run_cmd(['python3', Command.IP_ADD.value, 'edit', '-4', ipv4]) if ipv6: diff --git a/core/scripts/webpanel/routers/api/v1/config/ip.py b/core/scripts/webpanel/routers/api/v1/config/ip.py index 92e4d6e..04a88b7 100644 --- a/core/scripts/webpanel/routers/api/v1/config/ip.py +++ b/core/scripts/webpanel/routers/api/v1/config/ip.py @@ -57,9 +57,8 @@ async def edit_ip_api(body: EditInputBody): body: An instance of EditInputBody containing the new IPv4 and/or IPv6 addresses. """ try: - if not body.ipv4 and not body.ipv6: - raise HTTPException(status_code=400, detail='Error: You must specify either ipv4 or ipv6') - + # if not body.ipv4 and not body.ipv6: + # raise HTTPException(status_code=400, detail='Error: You must specify either ipv4 or ipv6') cli_api.edit_ip_address(str(body.ipv4), str(body.ipv6)) return DetailResponse(detail='IP address edited successfully.') except Exception as e: