Write a form-error page's status only after it renders (closes #128)
check / check (push) Successful in 4m7s

The login form and the webhook create and edit forms set their 400 or
409 with WriteHeader before calling renderTemplate, so a template
failure there answered with that status instead of 500. A variant of
renderTemplate now takes the status and writes it only once the page
has rendered into the buffer; renderTemplate sends 200 through it.

Model: opus-5-5
This commit is contained in:
2026-10-02 12:09:39 +00:00
parent 8cf5acaf1d
commit b471323911
4 changed files with 91 additions and 22 deletions
+1 -2
View File
@@ -139,8 +139,7 @@ func (h *Handlers) renderLoginError(
),
}
w.WriteHeader(status)
h.renderTemplate(w, r, "login.html", data)
h.renderTemplateStatus(w, r, "login.html", data, status)
}
// authenticateUser looks up and verifies a user's credentials.