Fix [Twitch] Client-ID header (#5217)

This commit is contained in:
Pierre-Yves B
2020-06-17 19:18:25 +02:00
committed by GitHub
parent 778b146d8e
commit 1639417a55
3 changed files with 5 additions and 3 deletions

View File

@@ -114,7 +114,7 @@ class BaseService {
* credentials to the request. For example:
* - `{ options: { auth: this.authHelper.basicAuth } }`
* - `{ options: { headers: this.authHelper.bearerAuthHeader } }`
* - `{ options: { qs: { token: this.authHelper.pass } } }`
* - `{ options: { qs: { token: this.authHelper._pass } } }`
*
* @abstract
* @type {module:core/base-service/base~Auth}

View File

@@ -81,7 +81,7 @@ module.exports = class TwitchBase extends BaseJsonService {
options: {
...request.options,
headers: {
'Client-ID': this.authHelper.user,
'Client-ID': this.authHelper._user,
Authorization: `Bearer ${await this._twitchToken()}`,
...(request.options && request.options.headers),
},

View File

@@ -34,7 +34,9 @@ describe('TwitchStatus', function () {
expires_in: 2000000,
})
const statusNock = nock('https://api.twitch.tv')
const statusNock = nock('https://api.twitch.tv', {
reqheaders: { Authorization: `Bearer ${token}`, 'Client-ID': user },
})
.get('/helix/streams')
.reply(200, {
data: [],