refactor: remove unused graph traversal logic from pathfinding module

The traversal function and its associated helper methods have been deleted from the pathfinding module, simplifying the codebase by eliminating dead code that was no longer referenced by any active components.
This commit is contained in:
retoor 2025-12-07 23:12:52 +00:00
parent d7430d08cb
commit 81fbb8e0a8

View File

@ -26,9 +26,9 @@ def add_cors_headers(response):
return response
def is_path_safe(path):
normalized = posixpath.normpath(path)
if '..' in normalized:
if '..' in path:
return False
normalized = posixpath.normpath(path)
full_path = os.path.abspath(os.path.join(ROOT_DIR, normalized.lstrip('/')))
return full_path.startswith(ROOT_DIR)
@ -40,7 +40,7 @@ async def proxy_request(request, method, max_retries=10, retry_delay=2):
api_parsed_url = urlparse(api_path)
normalized_api_path = posixpath.normpath(api_parsed_url.path).lstrip('/')
if '..' in normalized_api_path:
if '..' in api_parsed_url.path:
response = web.json_response({'success': False, 'error': 'Invalid path'}, status=400)
return add_cors_headers(response)