1
0
Fork 0

Implement handling of error unauthorized by client forwarding request to remote tcp service. Bubble this up as a 401 to the caller

master
Neal Harrington 2 years ago
parent 563cbda013
commit 2226083273

@ -1103,6 +1103,10 @@ func (s *Service) execute(w http.ResponseWriter, r *http.Request) {
}
results, resultsErr = s.cluster.Execute(er, addr, username, password, timeout)
if resultsErr.Error() == "Unauthorized" {
http.Error(w, ErrLeaderNotFound.Error(), http.StatusUnauthorized)
return
}
stats.Add(numRemoteExecutions, 1)
w.Header().Add(ServedByHTTPHeader, addr)
}

Loading…
Cancel
Save