Skip to content
This repository was archived by the owner on Jan 17, 2025. It is now read-only.

Commit 8a78528

Browse files
change a helpers to define UA
1 parent e131675 commit 8a78528

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

dynata_rex/helpers.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,6 @@
2323
DEFAULT_RETRIES = int(os.environ.get('DEFAULT_RETRIES', '3'))
2424

2525

26-
class MaxRetriesExceeded(Exception):
27-
pass
28-
29-
30-
class TimeoutExceeded(ReadTimeout):
31-
pass
32-
33-
3426
class TimeoutHTTPAdapter(HTTPAdapter):
3527

3628
def _wait(self, try_number):
@@ -66,6 +58,8 @@ def make_session(request_timeout=DEFAULT_TIMEOUT):
6658
"""Make a session and mount the TimeoutHTTPAdapter"""
6759
session = requests.Session()
6860
adapter = TimeoutHTTPAdapter(request_timeout=request_timeout)
61+
# TODO: Set dynata_rex.__version__ and use instead of 0.0.1
62+
session.headers["User-Agent"] = 'rex-sdk-python/0.0.1'
6963
session.mount('https://', adapter)
7064
session.mount('http://', adapter)
7165
return session

0 commit comments

Comments
 (0)