Skip to content

Commit

Permalink
CoinZoom: Add user-agent on unauthenticated requests
Browse files Browse the repository at this point in the history
  • Loading branch information
TheHolyRoger committed Apr 2, 2021
1 parent 4829815 commit 9cf4d70
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ async def _api_request(self,
qs_params: dict = params if method.upper() == "GET" else None
req_params = ujson.dumps(params) if method.upper() == "POST" and params is not None else None
# Generate auth headers if needed.
headers: dict = {"Content-Type": "application/json"}
headers: dict = {"Content-Type": "application/json", "User-Agent": "hummingbot"}
if is_auth_required:
headers: dict = self._coinzoom_auth.get_headers()
# Build request coro
Expand Down
2 changes: 1 addition & 1 deletion hummingbot/connector/exchange/coinzoom/coinzoom_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ async def api_call_with_retries(method,
shared_client=None,
try_count: int = 0) -> Dict[str, Any]:
url = f"{Constants.REST_URL}/{endpoint}"
headers = {"Content-Type": "application/json"}
headers = {"Content-Type": "application/json", "User-Agent": "hummingbot"}
http_client = shared_client if shared_client is not None else aiohttp.ClientSession()
# Build request coro
response_coro = http_client.request(method=method.upper(), url=url, headers=headers,
Expand Down

0 comments on commit 9cf4d70

Please sign in to comment.