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:
Paul Melnikow
2019-02-13 12:53:48 -04:00
committed by Caleb Cartwright
parent 56d374a467
commit 28948925c2
2 changed files with 6 additions and 16 deletions

View File

@@ -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]
}`,
})
}

View File

@@ -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]
}`,
})
}