Fix [Twitch] Client-ID header (#5217)
This commit is contained in:
@@ -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}
|
||||
|
||||
@@ -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),
|
||||
},
|
||||
|
||||
@@ -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: [],
|
||||
|
||||
Reference in New Issue
Block a user