don't write content to no content

This commit is contained in:
Samir Patel 2022-01-06 10:35:11 -06:00
parent 6e9efd0e09
commit 41bde6ccba

View file

@ -3536,9 +3536,7 @@ func (h *Handler) handleLogin(w http.ResponseWriter, r *http.Request) {
func (h *Handler) handleRedirect(w http.ResponseWriter, r *http.Request) {
if h.auth == nil {
w.Header().Add("Content-Type", "text/plain")
w.WriteHeader(http.StatusNoContent)
w.Write([]byte("")) //nolint:errcheck
http.Error(w, "", http.StatusNoContent)
return
}
h.auth.Redirect(w, r)