Skip to content

Commit

Permalink
ASA-8093 (#142) (#143)
Browse files Browse the repository at this point in the history
Handled the URL encoding issue with staging & A360 environment.
Addressed the PR comments
  • Loading branch information
vishalhcl-5960 authored Feb 28, 2024
1 parent fd12d18 commit c370181
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ protected String getReportStatus(String reportId) throws IOException, JSONExcept
}

String request_url = authProvider.getServer() + API_REPORT_STATUS;
request_url += String.format("?$top=100&$filter=Id eq %s&$count=false",reportId);
request_url += "?%24top=100&%24filter=Id%20eq%20"+reportId+"&%24count=false";
Map<String, String> request_headers = authProvider.getAuthorizationHeader(true);
request_headers.put(CONTENT_LENGTH, "0"); //$NON-NLS-1$

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public JSONObject getScanDetails(String scanId) throws IOException, JSONExceptio
return null;

String request_url = m_authProvider.getServer() + API_BASIC_DETAILS;
request_url +=String.format("?$filter=Id eq %s",scanId);
request_url += "?$filter=Id%20eq%20"+scanId;
Map<String, String> request_headers = m_authProvider.getAuthorizationHeader(true);

HttpClient client = new HttpClient(m_authProvider.getProxy(), m_authProvider.getacceptInvalidCerts());
Expand All @@ -153,7 +153,7 @@ public JSONObject getScanDetails(String scanId) throws IOException, JSONExceptio
return (JSONObject) array.getJSONObject(0);
}
} else if (response.getResponseCode() == -1) {
return new JSONObject().put(STATUS,UNKNOWN); //If the server is not reachable Internet disconnect
m_progress.setStatus(new Message(Message.ERROR, Messages.getMessage(ERROR_GETTING_DETAILS, scanId)));
} else if (response.getResponseCode() != HttpsURLConnection.HTTP_BAD_REQUEST) {
JSONArtifact json = response.getResponseBodyAsJSON();
if (json != null && ((JSONObject)json).has(MESSAGE))
Expand All @@ -179,7 +179,7 @@ public JSONArray getNonCompliantIssues(String scanId) throws IOException, JSONEx
return null;

String request_url = m_authProvider.getServer() + String.format(API_ISSUES_COUNT, "Scan", scanId);
request_url +="?$apply=groupby((Severity),aggregate($count as N))";
request_url += "?applyPolicies=All&%24apply=groupby%28%28Severity%29%2Caggregate%28%24count%20as%20N%29%29";
Map<String, String> request_headers = m_authProvider.getAuthorizationHeader(true);
request_headers.put("Content-Type", "application/json; charset=UTF-8");
request_headers.put("Accept", "application/json");
Expand Down

0 comments on commit c370181

Please sign in to comment.