Don't require project in generated client requests

pull/31/head
Jeff Mitchell 6 years ago
parent 828fee20a1
commit c6a9c970b0

@ -689,13 +689,18 @@ func (c *Client) NewRequest(ctx context.Context, method, requestPath string, bod
}
}
orgProjPath := path.Join("org", org)
if project != "" {
orgProjPath = path.Join(orgProjPath, "project", project)
}
req := &http.Request{
Method: method,
URL: &url.URL{
User: u.User,
Scheme: u.Scheme,
Host: host,
Path: path.Join(u.Path, "v1", "org", org, "project", project, requestPath),
Path: path.Join(u.Path, "v1", orgProjPath, requestPath),
},
Host: u.Host,
}

Loading…
Cancel
Save