Problem
shard_core renders a splash screen in place of an app's actual response (for every app). When an app returns an error or a non-OK status, the real response body — e.g. a FastAPI 422 {"detail":[...]} — is replaced by the splash HTML and lost. This makes debugging app/API errors from the client impossible: you only ever see the splash.
Scoping the splash off by path prefix (e.g. only wrap non-/api) is not viable — apps don't all use an /api prefix, and the splash is applied uniformly.
Desired behavior
Keep the user-facing splash as-is, but embed the original upstream response in the splash HTML, visually hidden, so a developer can read it via browser dev tools / view-source / the raw HTTP body. Options:
- A hidden element, e.g.
<script type="application/json" id="upstream-response">…</script> or <div hidden data-upstream>…</div>.
- Include at least: original status code and response body (and ideally
Content-Type).
- HTML-escape / encode the embedded body so it can't break the page or inject.
Acceptance
- Rendered splash looks unchanged to end users.
- The raw HTML of the splash contains the original status + response body in a hidden element, readable via dev tools.
- Works regardless of the app's URL scheme (no
/api assumption).
Context
Surfaced while debugging a controller 422 (POST /api/shards/{id}/core_update) — the FastAPI validation detail was swallowed by the splash. Supersedes the misfiled FreeshardBase/freeshard-controller#266 (wrong repo + wrong approach). Related: FreeshardBase/freeshard-controller#267.
Problem
shard_core renders a splash screen in place of an app's actual response (for every app). When an app returns an error or a non-OK status, the real response body — e.g. a FastAPI
422{"detail":[...]}— is replaced by the splash HTML and lost. This makes debugging app/API errors from the client impossible: you only ever see the splash.Scoping the splash off by path prefix (e.g. only wrap non-
/api) is not viable — apps don't all use an/apiprefix, and the splash is applied uniformly.Desired behavior
Keep the user-facing splash as-is, but embed the original upstream response in the splash HTML, visually hidden, so a developer can read it via browser dev tools / view-source / the raw HTTP body. Options:
<script type="application/json" id="upstream-response">…</script>or<div hidden data-upstream>…</div>.Content-Type).Acceptance
/apiassumption).Context
Surfaced while debugging a controller
422(POST /api/shards/{id}/core_update) — the FastAPI validation detail was swallowed by the splash. Supersedes the misfiled FreeshardBase/freeshard-controller#266 (wrong repo + wrong approach). Related: FreeshardBase/freeshard-controller#267.