-
-
Notifications
You must be signed in to change notification settings - Fork 31
Description
We're deploying dependency-track under a subpath (e.g. org.com/dependency-track for the frontend and org.com/dependency-track/api and org.com/dependency-track/health for the backend)
While using the client-go library and creating a new Client we're getting the following error-message:
ERROR Could not initialize DependencyTrack client error="failed to fetch version information: Not Found (status: 404)"
On first look the reason for this behavior is the general behavior of URL.Parse in Client.NewRequest. See below.
Line 147 in bd03e36
| u, err := c.baseURL.Parse(path) |
When using url.Parse any existing path of the url will be replaced by the path to parse. This behavior is visible in the documentation of URL.Parse or more specifically in URL.ResolveReference
A more flexible solution might be to use URL.JoinPath instead.