Fix /results polling: use sx_response() for SX wire format
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 2m56s

The /results endpoint returns SX wire format but was sending it with
content-type text/html. The SX engine couldn't process it, so raw
s-expressions appeared as text and the browser tried to resolve
quoted strings like "a.jpg" as URLs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-06 19:39:55 +00:00
parent 1e52bb33a6
commit 0385be0a0d

View File

@@ -89,6 +89,7 @@ def register(url_prefix: str = "/") -> Blueprint:
async def results():
"""HTMX partial — poll target for results table."""
from shared.browser.app.csrf import generate_csrf_token
from shared.sx.helpers import sx_response
from sxc.pages.renders import render_results_partial_sx
import runner
@@ -104,10 +105,9 @@ def register(url_prefix: str = "/") -> Blueprint:
active_service=active_service,
)
resp = Response(html, status=200, content_type="text/html")
# If still running, tell HTMX to keep polling
headers = {}
if running:
resp.headers["HX-Trigger-After-Swap"] = "test-still-running"
return resp
headers["HX-Trigger-After-Swap"] = "test-still-running"
return sx_response(html, headers=headers)
return bp