remove ResolveReference call

This commit is contained in:
Mendy Danzinger 2019-09-30 15:24:05 -04:00
parent 1f632d37f6
commit 09a8846daf
1 changed files with 1 additions and 3 deletions

View File

@ -227,13 +227,11 @@ func SetUserAgent(ua string) ClientOpt {
// BaseURL of the Client. Relative URLS should always be specified without a preceding slash. If specified, the
// value pointed to by body is JSON encoded and included in as the request body.
func (c *Client) NewRequest(ctx context.Context, method, urlStr string, body interface{}) (*http.Request, error) {
rel, err := url.Parse(urlStr)
u, err := c.BaseURL.Parse(urlStr)
if err != nil {
return nil, err
}
u := c.BaseURL.ResolveReference(rel)
buf := new(bytes.Buffer)
if body != nil {
err = json.NewEncoder(buf).Encode(body)