fix(master): redirect a cancelled Check now instead of an empty response (#35)

This commit is contained in:
2026-10-14 14:23:11 +02:00
parent e7c0e2fd61
commit 75bfa72145
2 changed files with 14 additions and 3 deletions
+5 -3
View File
@@ -633,13 +633,15 @@ func (s *Server) pollService(w http.ResponseWriter, r *http.Request) {
s.renderServiceError(w, r, id, http.StatusConflict, "Cannot check: "+np.Reason+".")
return
case r.Context().Err() != nil:
return // the client is gone
// The client is gone or the master is shutting down. Redirect anyway:
// a browser still waiting gets the page, not an empty 200.
case err != nil:
s.failLookup(w, err)
return
default:
sess, _ := webauth.SessionFrom(r.Context())
s.log.Info("poll_requested", "service_id", id, "subject", sess.Subject)
}
sess, _ := webauth.SessionFrom(r.Context())
s.log.Info("poll_requested", "service_id", id, "subject", sess.Subject)
http.Redirect(w, r, "/services/"+strconv.FormatInt(id, 10), http.StatusSeeOther)
}