mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2024-11-10 01:02:30 +01:00
Fix headers when using node-fetch
This commit is contained in:
parent
acc9537bb7
commit
4561148ab2
3 changed files with 13 additions and 3 deletions
|
@ -82,7 +82,10 @@ function sendWebhooks(userID: string, videoID: string, UUID: string, segmentInfo
|
|||
"url": data.items[0].snippet.thumbnails.maxres ? data.items[0].snippet.thumbnails.maxres.url : "",
|
||||
},
|
||||
}],
|
||||
})
|
||||
}),
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
})
|
||||
.then(res => {
|
||||
if (res.status >= 400) {
|
||||
|
@ -136,7 +139,10 @@ function sendWebhooksNB(userID: string, videoID: string, UUID: string, startTime
|
|||
"url": ytData.items[0].snippet.thumbnails.maxres ? ytData.items[0].snippet.thumbnails.maxres.url : "",
|
||||
},
|
||||
}],
|
||||
})
|
||||
}),
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
})
|
||||
.then(res => {
|
||||
if (res.status >= 400) {
|
||||
|
|
|
@ -113,7 +113,10 @@ function sendWebhooks(voteData: VoteData) {
|
|||
"url": data.items[0].snippet.thumbnails.maxres ? data.items[0].snippet.thumbnails.maxres.url : "",
|
||||
},
|
||||
}],
|
||||
})
|
||||
}),
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
})
|
||||
.then(async res => {
|
||||
if (res.status >= 400) {
|
||||
|
|
|
@ -42,6 +42,7 @@ function dispatchEvent(scope: string, data: any): void {
|
|||
headers: {
|
||||
"Authorization": authKey,
|
||||
"Event-Type": scope, // Maybe change this in the future?
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
})
|
||||
.catch(err => {
|
||||
|
|
Loading…
Reference in a new issue