mirror of
https://github.com/freqtrade/freqtrade.git
synced 2026-02-04 05:10:24 +00:00
Set session params instead of headers
This commit is contained in:
@@ -16,9 +16,10 @@ class FtCoinGeckoApi(CoinGeckoAPI):
|
||||
# Doint' pass api_key to parent, instead set the header on the session directly
|
||||
self._api_key = api_key
|
||||
|
||||
if api_key and not is_demo:
|
||||
self.api_base_url = self.__PRO_API_URL_BASE
|
||||
self.session.headers.update({"x-cg-pro-api-key": api_key})
|
||||
else:
|
||||
if api_key and is_demo:
|
||||
# Use demo api key
|
||||
self.api_base_url = self.__API_URL_BASE
|
||||
self.session.headers.update({"x-cg-demo-api-key": api_key})
|
||||
self.session.params.update({"x_cg_demo_api_key": api_key})
|
||||
else:
|
||||
self.api_base_url = self.__PRO_API_URL_BASE
|
||||
self.session.params.update({"x_cg_pro_api_key": api_key})
|
||||
|
||||
Reference in New Issue
Block a user