Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion internal/wrappers/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,23 @@ func GetAuthURL(path string) string {
return authURL
}

func SendPrivateHTTPRequestWithQueryParams(
method, path string, params map[string]string,
body io.Reader, timeout uint,
) (*http.Response, error) {
return HTTPRequestWithQueryParams(method, path, params, body, timeout, false)
}

func SendHTTPRequestWithQueryParams(
method, path string, params map[string]string,
body io.Reader, timeout uint,
) (*http.Response, error) {
return HTTPRequestWithQueryParams(method, path, params, body, timeout, true)
}

func HTTPRequestWithQueryParams(
method, path string, params map[string]string,
body io.Reader, timeout uint, printBody bool,
) (*http.Response, error) {
u := GetURL(path)
req, err := http.NewRequest(method, u, body)
Expand All @@ -253,7 +267,7 @@ func SendHTTPRequestWithQueryParams(
return nil, err
}
var resp *http.Response
resp, err = doRequest(client, req)
resp, err = request(client, req, printBody)
if err != nil {
return resp, errors.Errorf("%s %s \n", checkmarxURLError, req.URL.RequestURI())
}
Expand Down
2 changes: 1 addition & 1 deletion internal/wrappers/results-http.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func (r *ResultsHTTPWrapper) GetAllResultsByScanID(params map[string]string) (
clientTimeout := viper.GetUint(commonParams.ClientTimeoutKey)
// AST has a limit of 10000 results, this makes it get all of them
params["limit"] = "10000"
resp, err := SendHTTPRequestWithQueryParams(http.MethodGet, r.path, params, nil, clientTimeout)
resp, err := SendPrivateHTTPRequestWithQueryParams(http.MethodGet, r.path, params, nil, clientTimeout)
if err != nil {
return nil, nil, err
}
Expand Down