From 270586751b1869ad0c7a754e4ed8ae71bb22ef9d Mon Sep 17 00:00:00 2001 From: Nicholas Tindle Date: Wed, 28 Jan 2026 00:40:12 -0600 Subject: [PATCH] style(backend): format workspace routes and rest_api imports Co-Authored-By: Claude Opus 4.5 --- .../backend/backend/api/features/workspace/routes.py | 7 ++++--- autogpt_platform/backend/backend/api/rest_api.py | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/autogpt_platform/backend/backend/api/features/workspace/routes.py b/autogpt_platform/backend/backend/api/features/workspace/routes.py index 1eeafa0158..1495feeedf 100644 --- a/autogpt_platform/backend/backend/api/features/workspace/routes.py +++ b/autogpt_platform/backend/backend/api/features/workspace/routes.py @@ -23,19 +23,20 @@ def _sanitize_filename_for_header(filename: str) -> str: Uses RFC5987 encoding for non-ASCII characters. """ # Remove CR, LF, and null bytes (header injection prevention) - sanitized = re.sub(r'[\r\n\x00]', '', filename) + sanitized = re.sub(r"[\r\n\x00]", "", filename) # Escape quotes sanitized = sanitized.replace('"', '\\"') # For non-ASCII, use RFC5987 filename* parameter # Check if filename has non-ASCII characters try: - sanitized.encode('ascii') + sanitized.encode("ascii") return f'attachment; filename="{sanitized}"' except UnicodeEncodeError: # Use RFC5987 encoding for UTF-8 filenames - encoded = quote(filename, safe='') + encoded = quote(filename, safe="") return f"attachment; filename*=UTF-8''{encoded}" + logger = logging.getLogger(__name__) router = fastapi.APIRouter( diff --git a/autogpt_platform/backend/backend/api/rest_api.py b/autogpt_platform/backend/backend/api/rest_api.py index 9c24f43ce6..622714021d 100644 --- a/autogpt_platform/backend/backend/api/rest_api.py +++ b/autogpt_platform/backend/backend/api/rest_api.py @@ -46,7 +46,6 @@ from backend.integrations.providers import ProviderName from backend.monitoring.instrumentation import instrument_fastapi from backend.util import json from backend.util.cloud_storage import shutdown_cloud_storage_handler -from backend.util.workspace_storage import shutdown_workspace_storage from backend.util.exceptions import ( MissingConfigError, NotAuthorizedError, @@ -54,6 +53,7 @@ from backend.util.exceptions import ( ) from backend.util.feature_flag import initialize_launchdarkly, shutdown_launchdarkly from backend.util.service import UnhealthyServiceError +from backend.util.workspace_storage import shutdown_workspace_storage from .external.fastapi_app import external_api from .features.analytics import router as analytics_router