diff --git a/ox/cache.py b/ox/cache.py index b5f9a9e..c359cbd 100644 --- a/ox/cache.py +++ b/ox/cache.py @@ -102,6 +102,8 @@ def read_url(url, data=None, headers=None, timeout=cache_timeout, valid=None, un url_headers = {} if not result: if USE_REQUESTS: + if headers is None: + headers = DEFAULT_HEADERS.copy() r = requests_session.get(url, headers=headers) for key in r.headers: url_headers[key.lower()] = r.headers[key] diff --git a/ox/net.py b/ox/net.py index 59e6abe..3a07d91 100644 --- a/ox/net.py +++ b/ox/net.py @@ -21,7 +21,7 @@ from chardet.universaldetector import UniversalDetector DEBUG = False # Default headers for HTTP requests. DEFAULT_HEADERS = { - 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64; rv:69.0) Gecko/20100101 Firefox/69.0', + 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0', 'Accept-Charset': 'ISO-8859-1,utf-8;q=0.7,*;q=0.7', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'Accept-Language': 'en-US,en;q=0.8,fr;q=0.6,de;q=0.4',