From bdf5efdb763d18dae52565c5940902eff4eb4279 Mon Sep 17 00:00:00 2001 From: Jiachen Yang Date: Tue, 12 May 2015 08:28:27 +0900 Subject: [PATCH] use preview redirect api regardless if access token is set --- nvchecker/source/github.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/nvchecker/source/github.py b/nvchecker/source/github.py index 7b3ac72..2b666e2 100644 --- a/nvchecker/source/github.py +++ b/nvchecker/source/github.py @@ -10,12 +10,9 @@ def get_version(name, conf, callback): repo = conf.get('github') br = conf.get('branch', 'master') url = GITHUB_URL % (repo, br) - headers = {} + headers = {'Accept': "application/vnd.github.quicksilver-preview+json"} if 'NVCHECKER_GITHUB_TOKEN' in os.environ: - headers = { - 'Authorization': 'token %s' % os.environ['NVCHECKER_GITHUB_TOKEN'], - 'Accept': "application/vnd.github.quicksilver-preview+json" - } + headers['Authorization'] = 'token %s' % os.environ['NVCHECKER_GITHUB_TOKEN'] request = HTTPRequest(url, headers=headers) AsyncHTTPClient().fetch(request, user_agent='lilydjwg/nvchecker', callback=partial(_github_done, name, callback))