0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-20 22:42:53 -05:00

updated external request format

refs TryGhost/Team#2663
-got version upgrade broke this request
-moved to new format
This commit is contained in:
Steve Larson 2023-03-01 14:51:38 -06:00 committed by Kevin Ansfield
parent 9fa44f4d3f
commit 4fc131c49d
No known key found for this signature in database

View file

@ -57,14 +57,11 @@ class TwitterOEmbedProvider {
}).join('&'); }).join('&');
try { try {
const result = await externalRequest(`https://api.twitter.com/2/tweets/${tweetId}?${queryString}`, { const body = await externalRequest(`https://api.twitter.com/2/tweets/${tweetId}?${queryString}`, {
responseType: 'json',
headers: { headers: {
Authorization: `Bearer ${this.dependencies.config.bearerToken}` Authorization: `Bearer ${this.dependencies.config.bearerToken}`
} }
}); }).json();
const body = JSON.parse(result.body);
oembedData.tweet_data = body.data; oembedData.tweet_data = body.data;
oembedData.tweet_data.includes = body.includes; oembedData.tweet_data.includes = body.includes;