mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-11 22:17:14 +03:00
Fix headers when using node-fetch
This commit is contained in:
@@ -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 : "",
|
"url": data.items[0].snippet.thumbnails.maxres ? data.items[0].snippet.thumbnails.maxres.url : "",
|
||||||
},
|
},
|
||||||
}],
|
}],
|
||||||
})
|
}),
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json'
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.then(res => {
|
.then(res => {
|
||||||
if (res.status >= 400) {
|
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 : "",
|
"url": ytData.items[0].snippet.thumbnails.maxres ? ytData.items[0].snippet.thumbnails.maxres.url : "",
|
||||||
},
|
},
|
||||||
}],
|
}],
|
||||||
})
|
}),
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json'
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.then(res => {
|
.then(res => {
|
||||||
if (res.status >= 400) {
|
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 : "",
|
"url": data.items[0].snippet.thumbnails.maxres ? data.items[0].snippet.thumbnails.maxres.url : "",
|
||||||
},
|
},
|
||||||
}],
|
}],
|
||||||
})
|
}),
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json'
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.then(async res => {
|
.then(async res => {
|
||||||
if (res.status >= 400) {
|
if (res.status >= 400) {
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ function dispatchEvent(scope: string, data: any): void {
|
|||||||
headers: {
|
headers: {
|
||||||
"Authorization": authKey,
|
"Authorization": authKey,
|
||||||
"Event-Type": scope, // Maybe change this in the future?
|
"Event-Type": scope, // Maybe change this in the future?
|
||||||
|
'Content-Type': 'application/json'
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
|
|||||||
Reference in New Issue
Block a user