Skip to content

Commit 39c422b

Browse files
committed
chore: incorporate Copilot review comments
1 parent af8769c commit 39c422b

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

application/backend/app/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ async def security_headers_middleware(
8282
request: Request,
8383
call_next: Callable[[Request], Awaitable[Response]],
8484
) -> Response:
85-
""""""
85+
"""Add COEP and COOP security headers to all HTTP responses."""
8686
response = await call_next(request)
8787
response.headers.setdefault("Cross-Origin-Embedder-Policy", "require-corp")
8888
response.headers.setdefault("Cross-Origin-Opener-Policy", "same-origin")
@@ -98,7 +98,7 @@ async def security_headers_middleware(
9898

9999
@app.get("/", include_in_schema=False)
100100
@app.get("/{full_path:path}", include_in_schema=False)
101-
async def serve_spa(full_path: str = "") -> FileResponse: # noqa: ARG001
101+
async def serve_spa() -> FileResponse:
102102
"""Serve the Single Page Application (SPA) index.html file for any path."""
103103
return FileResponse(cast(Path, static_dir) / "index.html")
104104

application/backend/app/settings.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,11 @@ class Settings(BaseSettings):
3636
# Server
3737
host: str = Field(default="0.0.0.0", alias="HOST") # noqa: S104
3838
port: int = Field(default=7860, alias="PORT")
39-
static_files_dir: Path | None = None
39+
static_files_dir: Path | None = Field(
40+
default=None,
41+
alias="STATIC_FILES_DIR",
42+
description="Directory containing static UI files",
43+
)
4044

4145
# CORS
4246
cors_origins: str = Field(

0 commit comments

Comments
 (0)