internal: only handle relative paths in Client.ResolveHref
Don't prepend the endpoint path in front of absolute paths.
This commit is contained in:
@@ -36,11 +36,8 @@ func (c *Client) SetBasicAuth(username, password string) {
|
||||
}
|
||||
|
||||
func (c *Client) ResolveHref(p string) *url.URL {
|
||||
trailingSlash := strings.HasSuffix(p, "/")
|
||||
p = path.Join(c.endpoint.Path, p)
|
||||
// path.Join trims any trailing slash
|
||||
if trailingSlash {
|
||||
p += "/"
|
||||
if !strings.HasPrefix(p, "/") {
|
||||
p = path.Join(c.endpoint.Path, p)
|
||||
}
|
||||
return &url.URL{
|
||||
Scheme: c.endpoint.Scheme,
|
||||
|
Reference in New Issue
Block a user