From 6d9e057a91c2fd4e1645139c951725c632171706 Mon Sep 17 00:00:00 2001 From: SBCrumb Date: Wed, 22 Oct 2025 17:18:42 -0400 Subject: [PATCH] web: fix smart scan --- api/web_routes.py | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/api/web_routes.py b/api/web_routes.py index 487a2ee..930194c 100644 --- a/api/web_routes.py +++ b/api/web_routes.py @@ -1334,27 +1334,19 @@ def register_web_routes(app, dependencies): import os import socket - # Get request body - try: - body = await request.json() - except: - body = {} - # Get core container URL core_host = os.environ.get("CORE_API_HOST", "nfoguard-core") core_port = os.environ.get("CORE_API_PORT", "8080") + + # Forward query parameters from the request + query_string = str(request.url.query) if request.url.query else "" core_url = f"http://{core_host}:{core_port}/manual/scan" + if query_string: + core_url += f"?{query_string}" try: - # Prepare request data - data = json.dumps(body).encode('utf-8') - - # Create request with timeout - req = urllib.request.Request( - core_url, - data=data, - headers={'Content-Type': 'application/json'} - ) + # Create request with timeout (no body needed for query parameters) + req = urllib.request.Request(core_url, method='POST') # Make request with timeout with urllib.request.urlopen(req, timeout=30) as response: