Skip to content

Commit

Permalink
yandex_metrica: changed auth from params to headers (#3360)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vladislav Denisov authored and arikfr committed Jan 29, 2019
1 parent 2da5110 commit 53aecdc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion redash/query_runner/yandex_metrica.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,11 @@ def test_connection(self):

def _send_query(self, path='stat/v1/data', **kwargs):
token = kwargs.pop('oauth_token', self.configuration['token'])
r = requests.get('{0}/{1}'.format(self.host, path), params=dict(oauth_token=token, **kwargs))
r = requests.get(
'{0}/{1}'.format(self.host, path),
headers={'Authorization': 'OAuth {}'.format(token)},
params=kwargs
)
if r.status_code != 200:
raise Exception(r.text)
return r.json()
Expand Down

0 comments on commit 53aecdc

Please sign in to comment.