blackducksoftware / hub-client-go

Hub Client for Go (golang)
Apache License 2.0
9 stars 19 forks source link

NewWithApiTokenAndClient method doesn't work anymore and always return 500 #76

Open mfocuz opened 3 years ago

mfocuz commented 3 years ago

Due to hub-api-client doesn't have path normalization, it sends non-normalizeds path to sever and sever doesn't handle it as well.

Out endpoint API variable is http://blackducksoftware.com/ (pay attention on last slash "/") and method NewWithApiTokenAndClient has the following concat: url := baseURL + "/api/tokens/authenticate"

Due to above, final request is: POST //api/tokens/authenticate HTTP/1.1 Host: blackducksoftware.com

and response is "status":500, "error":"Internal Server Error", "message":"The request was rejected because the URL was not normalized.", "path":"//api/tokens/authenticate"