From 25f99adc6c854f27dc1df4a88bf8da5b01812f46 Mon Sep 17 00:00:00 2001 From: rvk <329491+rvankraaij@users.noreply.github.com> Date: Wed, 4 Aug 2021 21:19:28 +0200 Subject: Fix CORS issue for Radarr and Sonarr services --- src/components/services/Radarr.vue | 10 ++-------- src/components/services/Sonarr.vue | 10 ++-------- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/src/components/services/Radarr.vue b/src/components/services/Radarr.vue index 93831a7..3b88083 100644 --- a/src/components/services/Radarr.vue +++ b/src/components/services/Radarr.vue @@ -70,10 +70,7 @@ export default { }, methods: { fetchConfig: function () { - fetch(`${this.item.url}/api/health`, { - credentials: "include", - headers: { "X-Api-Key": `${this.item.apikey}` }, - }) + fetch(`${this.item.url}/api/health?apiKey=${this.item.apikey}`) .then((response) => { if (response.status != 200) { throw new Error(response.statusText); @@ -95,10 +92,7 @@ export default { console.error(e); this.serverError = true; }); - fetch(`${this.item.url}/api/queue`, { - credentials: "include", - headers: { "X-Api-Key": `${this.item.apikey}` }, - }) + fetch(`${this.item.url}/api/queue?apiKey=${this.item.apikey}`) .then((response) => { if (response.status != 200) { throw new Error(response.statusText); diff --git a/src/components/services/Sonarr.vue b/src/components/services/Sonarr.vue index 8cebac4..3460067 100644 --- a/src/components/services/Sonarr.vue +++ b/src/components/services/Sonarr.vue @@ -70,10 +70,7 @@ export default { }, methods: { fetchConfig: function () { - fetch(`${this.item.url}/api/health`, { - credentials: "include", - headers: { "X-Api-Key": `${this.item.apikey}` }, - }) + fetch(`${this.item.url}/api/health?apiKey=${this.item.apikey}`) .then((response) => { if (response.status != 200) { throw new Error(response.statusText); @@ -95,10 +92,7 @@ export default { console.error(e); this.serverError = true; }); - fetch(`${this.item.url}/api/queue`, { - credentials: "include", - headers: { "X-Api-Key": `${this.item.apikey}` }, - }) + fetch(`${this.item.url}/api/queue?apiKey=${this.item.apikey}`) .then((response) => { if (response.status != 200) { throw new Error(response.statusText); -- cgit v1.2.3 From 304362adfd5fe06d7b55fe99087543e09f1ef3d8 Mon Sep 17 00:00:00 2001 From: rvk <329491+rvankraaij@users.noreply.github.com> Date: Wed, 4 Aug 2021 21:26:15 +0200 Subject: Fix CORS issue for Radarr and Sonarr services --- src/components/services/Radarr.vue | 4 ++-- src/components/services/Sonarr.vue | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/services/Radarr.vue b/src/components/services/Radarr.vue index 3b88083..9d38292 100644 --- a/src/components/services/Radarr.vue +++ b/src/components/services/Radarr.vue @@ -70,7 +70,7 @@ export default { }, methods: { fetchConfig: function () { - fetch(`${this.item.url}/api/health?apiKey=${this.item.apikey}`) + fetch(`${this.item.url}/api/health?apikey=${this.item.apikey}`) .then((response) => { if (response.status != 200) { throw new Error(response.statusText); @@ -92,7 +92,7 @@ export default { console.error(e); this.serverError = true; }); - fetch(`${this.item.url}/api/queue?apiKey=${this.item.apikey}`) + fetch(`${this.item.url}/api/queue?apikey=${this.item.apikey}`) .then((response) => { if (response.status != 200) { throw new Error(response.statusText); diff --git a/src/components/services/Sonarr.vue b/src/components/services/Sonarr.vue index 3460067..7851b6b 100644 --- a/src/components/services/Sonarr.vue +++ b/src/components/services/Sonarr.vue @@ -70,7 +70,7 @@ export default { }, methods: { fetchConfig: function () { - fetch(`${this.item.url}/api/health?apiKey=${this.item.apikey}`) + fetch(`${this.item.url}/api/health?apikey=${this.item.apikey}`) .then((response) => { if (response.status != 200) { throw new Error(response.statusText); @@ -92,7 +92,7 @@ export default { console.error(e); this.serverError = true; }); - fetch(`${this.item.url}/api/queue?apiKey=${this.item.apikey}`) + fetch(`${this.item.url}/api/queue?apikey=${this.item.apikey}`) .then((response) => { if (response.status != 200) { throw new Error(response.statusText); -- cgit v1.2.3