mirror of
https://github.com/lilydjwg/nvchecker.git
synced 2025-03-10 06:14:02 +00:00
use preview redirect api regardless if access token is set
This commit is contained in:
parent
41df426ca5
commit
bdf5efdb76
1 changed files with 2 additions and 5 deletions
|
@ -10,12 +10,9 @@ def get_version(name, conf, callback):
|
||||||
repo = conf.get('github')
|
repo = conf.get('github')
|
||||||
br = conf.get('branch', 'master')
|
br = conf.get('branch', 'master')
|
||||||
url = GITHUB_URL % (repo, br)
|
url = GITHUB_URL % (repo, br)
|
||||||
headers = {}
|
headers = {'Accept': "application/vnd.github.quicksilver-preview+json"}
|
||||||
if 'NVCHECKER_GITHUB_TOKEN' in os.environ:
|
if 'NVCHECKER_GITHUB_TOKEN' in os.environ:
|
||||||
headers = {
|
headers['Authorization'] = 'token %s' % os.environ['NVCHECKER_GITHUB_TOKEN']
|
||||||
'Authorization': 'token %s' % os.environ['NVCHECKER_GITHUB_TOKEN'],
|
|
||||||
'Accept': "application/vnd.github.quicksilver-preview+json"
|
|
||||||
}
|
|
||||||
request = HTTPRequest(url, headers=headers)
|
request = HTTPRequest(url, headers=headers)
|
||||||
AsyncHTTPClient().fetch(request, user_agent='lilydjwg/nvchecker',
|
AsyncHTTPClient().fetch(request, user_agent='lilydjwg/nvchecker',
|
||||||
callback=partial(_github_done, name, callback))
|
callback=partial(_github_done, name, callback))
|
||||||
|
|
Loading…
Add table
Reference in a new issue