From be3b82fd60e1e85d716883bd2d240d642befa0b3 Mon Sep 17 00:00:00 2001 From: Marius Niveri Date: Fri, 8 Nov 2024 22:52:07 +0100 Subject: [PATCH] fix(#122): join basePath and restPath correctly in jiraRequest --- internal/jira/jira_request.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/jira/jira_request.go b/internal/jira/jira_request.go index 85f437a..91e5cb5 100644 --- a/internal/jira/jira_request.go +++ b/internal/jira/jira_request.go @@ -6,6 +6,7 @@ import ( "io" "net/http" "net/url" + "path" ) func (api *httpApi) jiraRequest(method string, restPath string, queryParams interface{}, reqBody io.Reader) ([]byte, error) { @@ -13,7 +14,7 @@ func (api *httpApi) jiraRequest(method string, restPath string, queryParams inte if err != nil { return nil, err } - u := api.restUrl.ResolveReference(&url.URL{Path: restPath, RawQuery: queryParamsValues.Encode()}) + u := api.restUrl.ResolveReference(&url.URL{Path: path.Join(api.restUrl.Path, restPath), RawQuery: queryParamsValues.Encode()}) req, err := http.NewRequest(method, u.String(), reqBody) req.Header.Add("Accept", "application/json") req.Header.Add("Content-Type", "application/json")