client-go icon indicating copy to clipboard operation
client-go copied to clipboard

fix: correctly perform requests for dt deployed on subpaths, #51

Open aurifi opened this issue 1 month ago • 1 comments

Previously if the dependency-track baseURL was under a subpath, client-go would ignore that subpath and therefore perform requests to nonexisting urls.

The reason for the defect is the behavior of URL.Parse, which uses URL.ResolveReference. From the docs:

If ref is an absolute URL, then ResolveReference ignores base and returns a copy of ref.

Therefore if the leading slash is omitted both instances on the root of a domain aswell as Dependency Track deployed on a subpath will be supported.

aurifi avatar Nov 21 '25 20:11 aurifi

:white_check_mark: Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
:white_check_mark: Open Source Security 0 0 0 0 0 issues

:computer: Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

owasp-dt-bot avatar Nov 21 '25 20:11 owasp-dt-bot