1
0
mirror of https://github.com/jhillyerd/inbucket.git synced 2025-12-17 09:37:02 +00:00

[Rest Client] changing to enable relative urls (#477)

* changing to enable relative urls

Signed-off-by: Corey Aloia <corey.aloia@sap.com>
This commit is contained in:
corey-aloia
2024-02-09 17:53:44 +01:00
committed by GitHub
parent 975cb4ca5e
commit 3112deb3e6
2 changed files with 41 additions and 30 deletions

View File

@@ -22,11 +22,7 @@ type restClient struct {
// do performs an HTTP request with this client and returns the response.
func (c *restClient) do(method, uri string, body []byte) (*http.Response, error) {
rel, err := url.Parse(uri)
if err != nil {
return nil, err
}
url := c.baseURL.ResolveReference(rel)
url := c.baseURL.JoinPath(uri)
var r io.Reader
if body != nil {
r = bytes.NewReader(body)