reddit: fix downloads not working without cookies
This commit is contained in:
parent
44292ea622
commit
e4646a9ff3
1 changed files with 6 additions and 2 deletions
|
@ -59,9 +59,13 @@ export default async function(obj) {
|
|||
|
||||
let data = await fetch(
|
||||
url, {
|
||||
headers: accessToken && { authorization: `Bearer ${accessToken}` }
|
||||
headers: {
|
||||
'User-Agent': genericUserAgent,
|
||||
accept: 'application/json',
|
||||
authorization: accessToken && `Bearer ${accessToken}`
|
||||
}
|
||||
}
|
||||
).then(r => r.json() ).catch(() => {});
|
||||
).then(r => r.json()).catch(() => {});
|
||||
|
||||
if (!data || !Array.isArray(data)) return { error: 'ErrorCouldntFetch' };
|
||||
|
||||
|
|
Loading…
Reference in a new issue