mirror of
https://github.com/wukko/cobalt.git
synced 2025-04-30 14:34:27 +02:00
api/twitter: handle 403 with no cookie in requestTweet()
This commit is contained in:
parent
9639c599f0
commit
69dd37c5c3
@ -89,13 +89,16 @@ const requestTweet = async(dispatcher, tweetId, token, cookie) => {
|
|||||||
|
|
||||||
// we might have been missing the `ct0` cookie, retry
|
// we might have been missing the `ct0` cookie, retry
|
||||||
if (result.status === 403 && result.headers.get('set-cookie')) {
|
if (result.status === 403 && result.headers.get('set-cookie')) {
|
||||||
result = await fetch(graphqlTweetURL, {
|
const cookieValues = cookie?.values();
|
||||||
headers: {
|
if (cookieValues?.ct0) {
|
||||||
...headers,
|
result = await fetch(graphqlTweetURL, {
|
||||||
'x-csrf-token': cookie.values().ct0
|
headers: {
|
||||||
},
|
...headers,
|
||||||
dispatcher
|
'x-csrf-token': cookieValues.ct0
|
||||||
});
|
},
|
||||||
|
dispatcher
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
Loading…
x
Reference in New Issue
Block a user