mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-05 20:27:52 +08:00
fix: restore github api querystring (#3964)
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
const got = require('@/utils/got');
|
const got = require('@/utils/got');
|
||||||
const config = require('@/config').value;
|
const config = require('@/config').value;
|
||||||
|
const queryString = require('query-string');
|
||||||
|
|
||||||
module.exports = async (ctx) => {
|
module.exports = async (ctx) => {
|
||||||
const user = ctx.params.user;
|
const user = ctx.params.user;
|
||||||
@@ -14,6 +15,10 @@ module.exports = async (ctx) => {
|
|||||||
headers.Authorization = `token ${config.github.access_token}`;
|
headers.Authorization = `token ${config.github.access_token}`;
|
||||||
}
|
}
|
||||||
const res = await got.get(`https://api.github.com/repos/${user}/${repo}/commits`, {
|
const res = await got.get(`https://api.github.com/repos/${user}/${repo}/commits`, {
|
||||||
|
searchParams: queryString.stringify({
|
||||||
|
sha: branch,
|
||||||
|
path: filepath,
|
||||||
|
}),
|
||||||
headers,
|
headers,
|
||||||
});
|
});
|
||||||
const list = res.data;
|
const list = res.data;
|
||||||
|
|||||||
Reference in New Issue
Block a user