fix(hermes): Removes the duplicated implementation by reusing the existing handler, with no change to request or response behavior. (incident sonar/metis/go:S4144/AZ3Aes6wKy9i4pkIsOW8)

This commit is contained in:
Hermes Agent 2026-08-07 10:18:36 +00:00
parent d7a1dc0b74
commit 354e9d48fa

View File

@ -150,17 +150,7 @@ func statusForJobError(err error) int {
} }
func (a *App) handleWatch(w http.ResponseWriter, r *http.Request) { func (a *App) handleWatch(w http.ResponseWriter, r *http.Request) {
if r.Method != http.MethodPost { a.handleInternalWatch(w, r)
http.Error(w, "method not allowed", http.StatusMethodNotAllowed)
return
}
event, err := a.WatchSentinel()
if err != nil {
a.metrics.RecordWatch("error")
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
writeJSON(w, http.StatusOK, event)
} }
func (a *App) handleIndex(w http.ResponseWriter, r *http.Request) { func (a *App) handleIndex(w http.ResponseWriter, r *http.Request) {