app/vmalert: fix after da10962d4c

This commit is contained in:
Aliaksandr Valialkin 2022-07-25 09:46:26 +03:00
parent da10962d4c
commit 764fc04756
No known key found for this signature in database
GPG Key ID: A72BEC6CD3D0DED1

View File

@ -344,11 +344,12 @@ func selectHandler(qt *querytracer.Tracer, startTime time.Time, w http.ResponseW
return true
}
if path == "/vmalert" {
http.Redirect(w, r, path+"/", http.StatusMovedPermanently)
if p.Suffix == "prometheus/vmalert" {
path := "../" + p.Suffix + "/"
http.Redirect(w, r, path, http.StatusMovedPermanently)
return true
}
if strings.HasPrefix(path, "/vmalert/") {
if strings.HasPrefix(p.Suffix, "prometheus/vmalert/") {
vmalertRequests.Inc()
if len(*vmalertProxyURL) == 0 {
w.WriteHeader(http.StatusBadRequest)