Skip to content

Commit

Permalink
fix(mk-5#122): join basePath and restPath correctly in jiraRequest
Browse files Browse the repository at this point in the history
  • Loading branch information
m4r1vs committed Nov 8, 2024
1 parent db02e39 commit be3b82f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/jira/jira_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ import (
"io"
"net/http"
"net/url"
"path"
)

func (api *httpApi) jiraRequest(method string, restPath string, queryParams interface{}, reqBody io.Reader) ([]byte, error) {
queryParamsValues, err := query.Values(queryParams)
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")
Expand Down

0 comments on commit be3b82f

Please sign in to comment.