Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def retrieve(self, job_state):
headers = {
'User-agent': urlwatch.__user_agent__,
}
proxies = {
'http': os.getenv('HTTP_PROXY'),
'https': os.getenv('HTTPS_PROXY'),
}
if job_state.etag is not None:
headers['If-None-Match'] = job_state.etag
if job_state.timestamp is not None:
headers['If-Modified-Since'] = email.utils.formatdate(job_state.timestamp)
if self.ignore_cached or job_state.tries > 0:
headers['If-None-Match'] = None
headers['If-Modified-Since'] = email.utils.formatdate(0)