MCPcopy Create free account
hub / github.com/adobe/Marinus / make_https_request

Function make_https_request

python3_cron_scripts/get_crt_sh.py:65–83  ·  view source on GitHub ↗

Utility function for making HTTPS requests.

(logger, url, jobs_manager, download=False)

Source from the content-addressed store, hash-verified

63
64
65def make_https_request(logger, url, jobs_manager, download=False):
66 """
67 Utility function for making HTTPS requests.
68 """
69 try:
70 req = requests_retry_session().get(url, timeout=120)
71 except Exception as ex:
72 logger.error("Connection died after 5 tries")
73 logger.error(str(ex))
74 jobs_manager.record_job_error()
75 exit(1)
76
77 if req.status_code != 200:
78 return None
79
80 if download:
81 return req.content
82
83 return req.text
84
85
86def get_tracked_zone(name, zones):

Callers 2

mainFunction · 0.70

Calls 2

record_job_errorMethod · 0.80
requests_retry_sessionFunction · 0.70

Tested by

no test coverage detected