From 9cf4d7050ff88108d040b44a6e64dea9a0ffa724 Mon Sep 17 00:00:00 2001 From: TheHolyRoger Date: Fri, 2 Apr 2021 19:11:15 +0100 Subject: [PATCH] CoinZoom: Add user-agent on unauthenticated requests --- hummingbot/connector/exchange/coinzoom/coinzoom_exchange.py | 2 +- hummingbot/connector/exchange/coinzoom/coinzoom_utils.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hummingbot/connector/exchange/coinzoom/coinzoom_exchange.py b/hummingbot/connector/exchange/coinzoom/coinzoom_exchange.py index 14b92c136d..a4ab472965 100644 --- a/hummingbot/connector/exchange/coinzoom/coinzoom_exchange.py +++ b/hummingbot/connector/exchange/coinzoom/coinzoom_exchange.py @@ -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 diff --git a/hummingbot/connector/exchange/coinzoom/coinzoom_utils.py b/hummingbot/connector/exchange/coinzoom/coinzoom_utils.py index 599cadc967..498ed56541 100644 --- a/hummingbot/connector/exchange/coinzoom/coinzoom_utils.py +++ b/hummingbot/connector/exchange/coinzoom/coinzoom_utils.py @@ -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,