Skip to content

Commit

Permalink
fix: Snyk CWE-295 issue in remote_resource module (#4188)
Browse files Browse the repository at this point in the history
Signed-off-by: Xiangce Liu <[email protected]>
(cherry picked from commit 5166086)
  • Loading branch information
xiangce authored and chenlizhong committed Aug 15, 2024
1 parent c1c538d commit 84df521
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions insights/core/remote_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,11 @@ def get(self, url, params={}, headers={}, auth=(), certificate_path=None):
Returns:
response: (HttpResponse): Response object from requests.get api request
"""

certificate_path = certificate_path if certificate_path else False
return self.session.get(url, params=params, headers=headers, verify=certificate_path, auth=auth,
timeout=self.timeout)
if certificate_path:
return self.session.get(url, params=params, headers=headers,
verify=certificate_path, auth=auth, timeout=self.timeout)
return self.session.get(url, params=params, headers=headers,
auth=auth, timeout=self.timeout)


class CachedRemoteResource(RemoteResource):
Expand Down

0 comments on commit 84df521

Please sign in to comment.