Datasources: Handle URL parsing error (#25742)
Adds handling of error returned from URL parsing. Fixes #25714
This commit is contained in:
@@ -154,12 +154,14 @@ func (c *baseClientImpl) encodeBatchRequests(requests []*multiRequest) ([]byte,
|
||||
}
|
||||
|
||||
func (c *baseClientImpl) executeRequest(method, uriPath, uriQuery string, body []byte) (*response, error) {
|
||||
u, _ := url.Parse(c.ds.Url)
|
||||
u, err := url.Parse(c.ds.Url)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
u.Path = path.Join(u.Path, uriPath)
|
||||
u.RawQuery = uriQuery
|
||||
|
||||
var req *http.Request
|
||||
var err error
|
||||
if method == http.MethodPost {
|
||||
req, err = http.NewRequest(http.MethodPost, u.String(), bytes.NewBuffer(body))
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user