fix: double-check iframe src with HEAD probe before loading

After status/ready=true, do HEAD request to the iframe URL itself.
If it returns 5xx, keep polling. This prevents Bad Gateway appearing
in the iframe when container is technically registered but not yet serving.
This commit is contained in:
2026-07-23 10:55:42 +00:00
parent a1479aa47a
commit 9839539206
+9 -4
View File
@@ -1679,10 +1679,15 @@ def session_view_page(session_id: str, request: Request, user: User = Depends(re
if (r.ok) {{
const data = await r.json();
if (data.ready) {{
const f = document.getElementById('app-frame');
f.src = iframeSrc;
f.style.display = '';
return;
try {{
const probe = await fetch(iframeSrc, {{method:'HEAD', credentials:'include'}});
if (probe.status < 500) {{
const f = document.getElementById('app-frame');
f.src = iframeSrc;
f.style.display = '';
return;
}}
}} catch(e) {{}}
}}
}}
}} catch(e) {{}}