Write a form-error page's status only after it renders (closes #128)
check / check (push) Successful in 4m7s
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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user