From 08e6cfd89f88db474fad2ca0ce31bf06f420eb3d Mon Sep 17 00:00:00 2001 From: r0cky <44518337+r0ckysec@users.noreply.github.com> Date: Tue, 16 Nov 2021 15:48:38 +0800 Subject: [PATCH] fix github api 400 Bad Request Must specify access token via Authorization header. https://developer.github.com/changes/2020-02-10-deprecating-auth-through-query-param --- modules/search/github_api.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/search/github_api.py b/modules/search/github_api.py index 71dec48..1d6ee8d 100644 --- a/modules/search/github_api.py +++ b/modules/search/github_api.py @@ -23,6 +23,8 @@ class GithubAPI(Search): self.proxy = self.get_proxy(self.source) self.header.update( {'Accept': 'application/vnd.github.v3.text-match+json'}) + self.header.update( + {'Authorization': 'token ' + self.token}) page = 1 while True: