Skip to content

Commit

Permalink
Fix 403 CORS issue
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitrySharabin committed Nov 1, 2023
1 parent b1bce4c commit 274c6dc
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions mavo-yandex.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const _ = Mavo.Backend.register(
response = await fetch(call);
if (response.ok) {
const resource = await response.json();
response = await fetch(resource.href);
response = await fetch(resource.href, { referrerPolicy: "no-referrer" });
}
else {
return null;
Expand All @@ -75,7 +75,10 @@ const _ = Mavo.Backend.register(
response = await fetch(`${_.apiDomain}resources/download?path=/${this.path}`, { headers });
if (response.ok) {
const resource = await response.json();
response = await fetch(resource.href, { headers });
response = await fetch(resource.href, {
referrerPolicy: "no-referrer",
headers
});
}
else {
return null;
Expand Down Expand Up @@ -191,7 +194,6 @@ const _ = Mavo.Backend.register(
static apiDomain = "https://cloud-api.yandex.net/v1/disk/";
static oAuth = "https://oauth.yandex.ru/authorize";
static key = "058fa9986615469dbed89ff6b5983038"; // Client ID
static useCache = false;

/**
* Parse Yandex Disk URLs.
Expand Down

0 comments on commit 274c6dc

Please sign in to comment.