Merge pull request #262 from mdanzinger/master

remove ResolveReference call
This commit is contained in:
Ben Tranter 2019-09-30 15:46:22 -04:00 committed by GitHub
commit 97ac73b1d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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)