mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
API: Do not expose user input in datasource error responses (#52992)
This commit is contained in:
parent
ba76f9b580
commit
87004cc22d
@ -318,7 +318,8 @@ func (hs *HTTPServer) DeleteDataSourceByName(c *models.ReqContext) response.Resp
|
||||
|
||||
func validateURL(cmdType string, url string) response.Response {
|
||||
if _, err := datasource.ValidateURL(cmdType, url); err != nil {
|
||||
return response.Error(400, fmt.Sprintf("Validation error, invalid URL: %q", url), err)
|
||||
datasourcesLogger.Error("Failed to validate URL", "url", url)
|
||||
return response.Error(http.StatusBadRequest, "Validation error, invalid URL", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
|
Loading…
Reference in New Issue
Block a user