Alerting: Recact html responses (#35277) (#35282)

(cherry picked from commit fba90b8f9b)

Co-authored-by: Sofia Papagiannaki <papagian@users.noreply.github.com>
This commit is contained in:
Grot (@grafanabot)
2021-06-04 21:29:23 +03:00
committed by GitHub
co-authored by Sofia Papagiannaki
parent a95c3419b7
commit 557c310c8c
+4
View File
@@ -118,6 +118,10 @@ func (p *AlertingProxy) withReq(
errMessage = message.(string)
}
}
} else if strings.HasPrefix(resp.Header().Get("Content-Type"), "text/html") {
// if Content-Type is text/html
// do not return the body
errMessage = "redacted html"
}
return ErrResp(status, errors.New(errMessage), "")
}