fix(master): redirect a cancelled Check now instead of an empty response (#35)
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user