Alerting: Recact html responses (#35277)

This commit is contained in:
Sofia Papagiannaki 2021-06-04 20:57:24 +03:00 committed by GitHub
parent 8cda1f5153
commit fba90b8f9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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), "")
}