mirror of
https://github.com/grafana/grafana.git
synced 2026-08-11 05:34:53 -05:00
API: Do not expose user input in datasource error responses (#52992)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user