From 274c6dcff486fe2bf0218874601c224804912b21 Mon Sep 17 00:00:00 2001 From: Dmitry Sharabin Date: Wed, 1 Nov 2023 09:29:33 +0100 Subject: [PATCH] Fix 403 CORS issue --- mavo-yandex.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/mavo-yandex.js b/mavo-yandex.js index 650b7bc..906021b 100644 --- a/mavo-yandex.js +++ b/mavo-yandex.js @@ -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; @@ -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; @@ -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.