mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-05 12:21:31 +08:00
feat: github Basic Authentication
This commit is contained in:
@@ -14,6 +14,10 @@ module.exports = async (ctx) => {
|
||||
const host = `https://github.com/${user}/${repo}/issues`;
|
||||
const url = `https://api.github.com/repos/${user}/${repo}/issues`;
|
||||
|
||||
const headers = {};
|
||||
if (config.github && config.github.access_token) {
|
||||
headers.Authorization = `token ${config.github.access_token}`;
|
||||
}
|
||||
const response = await got({
|
||||
method: 'get',
|
||||
url,
|
||||
@@ -21,8 +25,8 @@ module.exports = async (ctx) => {
|
||||
state: state,
|
||||
labels: labels,
|
||||
sort: 'created',
|
||||
access_token: config.github && config.github.access_token,
|
||||
}),
|
||||
headers,
|
||||
});
|
||||
const data = response.data;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user