Skip to content

Commit

Permalink
Fixed API Version to be used always
Browse files Browse the repository at this point in the history
  • Loading branch information
miballe committed Oct 15, 2024
1 parent cbb3ce8 commit d14957d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/factiva/analytics/common/req.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,17 @@ def api_send_request(method:str='GET',
if not isinstance(headers, dict):
raise ValueError('Unexpected headers value')

headers.update({
'X-API-VERSION': const.API_LATEST_VERSION
})

vsum = 'f4c71v4f4c71v4f4c71v4f4c71v4f4c7'
if 'user-key' in headers:
vsum = tools.md5hash(headers['user-key'])

if config.USERAGENT:
headers.update({
'User-Agent': f'RDL-Python-{__version__}-{vsum}',
'X-API-VERSION': const.API_LATEST_VERSION
'User-Agent': f'RDL-Python-{__version__}-{vsum}'
})
__log.debug(f"{method} Request with User-Agent {headers['User-Agent']}")

Expand Down

0 comments on commit d14957d

Please sign in to comment.