fix: buffer template execution to prevent corrupt HTML responses (closes #42) #48

Merged
sneak merged 2 commits from :fix/template-execution-buffering into main 2026-02-16 07:05:45 +01:00

2 Commits

Author SHA1 Message Date
448879b4ef Merge branch 'main' into fix/template-execution-buffering 2026-02-16 07:05:36 +01:00
user
af9ffddf84 fix: buffer template execution to prevent corrupt HTML responses (closes #42)
Add renderTemplate helper method on Handlers that renders templates to a
bytes.Buffer first, then writes to the ResponseWriter only on success.
This prevents partial/corrupt HTML when template execution fails partway
through.

Applied to all template rendering call sites in:
- setup.go (HandleSetupGET, renderSetupError)
- auth.go (HandleLoginGET, HandleLoginPOST error paths)
- dashboard.go (HandleDashboard)
- app.go (HandleAppNew, HandleAppCreate, HandleAppDetail, HandleAppEdit,
  HandleAppUpdate, HandleAppDeployments)
2026-02-15 22:04:09 -08:00