Skip to content

Commit 57d7e93

Browse files
m4r1vsmk-5
authored andcommitted
fix(#122): join basePath and restPath correctly in jiraRequest
1 parent db02e39 commit 57d7e93

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

internal/jira/jira_request.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@ import (
66
"io"
77
"net/http"
88
"net/url"
9+
"path"
910
)
1011

1112
func (api *httpApi) jiraRequest(method string, restPath string, queryParams interface{}, reqBody io.Reader) ([]byte, error) {
1213
queryParamsValues, err := query.Values(queryParams)
1314
if err != nil {
1415
return nil, err
1516
}
16-
u := api.restUrl.ResolveReference(&url.URL{Path: restPath, RawQuery: queryParamsValues.Encode()})
17+
u := api.restUrl.ResolveReference(&url.URL{Path: path.Join(api.restUrl.Path, restPath), RawQuery: queryParamsValues.Encode()})
1718
req, err := http.NewRequest(method, u.String(), reqBody)
1819
req.Header.Add("Accept", "application/json")
1920
req.Header.Add("Content-Type", "application/json")

0 commit comments

Comments
 (0)