Remove unused parameter in [jsdelivr] (#2988)
`headers` is not destructured; it needs to go in `options`. `Shields.io` is set as the `User-Agent` by code in `legacy-request-handler.js`.
This commit is contained in:
committed by
Caleb Cartwright
parent
56d374a467
commit
28948925c2
@@ -21,16 +21,11 @@ module.exports = class jsDelivrHitsGitHub extends BaseJsDelivrService {
|
||||
}
|
||||
|
||||
async fetch({ period, user, repo }) {
|
||||
const url = `https://data.jsdelivr.com/v1/package/gh/${user}/${repo}/stats/date/${
|
||||
periodMap[period]
|
||||
}`
|
||||
|
||||
return this._requestJson({
|
||||
schema,
|
||||
url,
|
||||
headers: {
|
||||
'User-Agent': 'Shields.io',
|
||||
},
|
||||
url: `https://data.jsdelivr.com/v1/package/gh/${user}/${repo}/stats/date/${
|
||||
periodMap[period]
|
||||
}`,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -21,16 +21,11 @@ module.exports = class jsDelivrHitsNPM extends BaseJsDelivrService {
|
||||
}
|
||||
|
||||
async fetch({ period, pkg }) {
|
||||
const url = `https://data.jsdelivr.com/v1/package/npm/${pkg}/stats/date/${
|
||||
periodMap[period]
|
||||
}`
|
||||
|
||||
return this._requestJson({
|
||||
schema,
|
||||
url,
|
||||
headers: {
|
||||
'User-Agent': 'Shields.io',
|
||||
},
|
||||
url: `https://data.jsdelivr.com/v1/package/npm/${pkg}/stats/date/${
|
||||
periodMap[period]
|
||||
}`,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user