Skip to content

Commit fca4303

Browse files
authored
Fix root HTML UTF-8 read to prevent Windows 500 (#49)
1 parent 49a7860 commit fca4303

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

backend/api.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,7 @@ async def read_root():
231231
"""Serve the main HTML page."""
232232
html_path = Path(__file__).parent / "static" / "index.html"
233233
if html_path.exists():
234-
with open(html_path) as f:
235-
return HTMLResponse(content=f.read())
234+
return HTMLResponse(content=html_path.read_text(encoding="utf-8"))
236235
return HTMLResponse(
237236
content="<h1>VinylFlow</h1><p>Frontend not found. Please create static/index.html</p>"
238237
)

0 commit comments

Comments
 (0)