From 580b606ae8a4ba69f1ecdea7263c4d34b6e48e52 Mon Sep 17 00:00:00 2001 From: Ajit Kumar Date: Sun, 13 Sep 2026 02:10:03 +0530 Subject: [PATCH] fix: API calls throwing internal server errors --- src/lib/acode.js | 3 +++ src/lib/installPlugin.js | 3 +++ src/pages/plugin/plugin.js | 6 ++++++ src/pages/sponsor/sponsor.js | 3 +++ 4 files changed, 15 insertions(+) diff --git a/src/lib/acode.js b/src/lib/acode.js index d5a0f2de62..668a5356db 100644 --- a/src/lib/acode.js +++ b/src/lib/acode.js @@ -658,6 +658,9 @@ class Acode { const purchase = await getPurchase(product.productId); await fetch(Url.join(config.API_BASE, "plugin/order"), { method: "POST", + headers: { + "Content-Type": "application/json", + }, body: JSON.stringify({ id: remotePlugin.id, token: purchase?.purchaseToken, diff --git a/src/lib/installPlugin.js b/src/lib/installPlugin.js index 9dd31ab78a..0a7e8407e1 100644 --- a/src/lib/installPlugin.js +++ b/src/lib/installPlugin.js @@ -470,6 +470,9 @@ async function resolveDep(manifest) { const purchase = await getPurchase(product.productId); await fetch(Url.join(config.API_BASE, "plugin/order"), { method: "POST", + headers: { + "Content-Type": "application/json", + }, body: JSON.stringify({ id: manifest.id, token: purchase?.purchaseToken, diff --git a/src/pages/plugin/plugin.js b/src/pages/plugin/plugin.js index f4c91d74ba..8afc97a263 100644 --- a/src/pages/plugin/plugin.js +++ b/src/pages/plugin/plugin.js @@ -323,6 +323,9 @@ export default async function PluginInclude( const purchase = await getPurchase(product.productId); await fetch(Url.join(config.API_BASE, "plugin/order"), { method: "POST", + headers: { + "Content-Type": "application/json", + }, body: JSON.stringify({ id: plugin.id, token: purchase?.purchaseToken, @@ -382,6 +385,9 @@ export default async function PluginInclude( $button.textContent = strings["loading..."]; const res = await fetch(Url.join(config.API_BASE, "plugin/refund"), { method: "POST", + headers: { + "Content-Type": "application/json", + }, body: JSON.stringify({ id: plugin.id, package: BuildInfo.packageName, diff --git a/src/pages/sponsor/sponsor.js b/src/pages/sponsor/sponsor.js index f0ccf46750..02b53475fd 100644 --- a/src/pages/sponsor/sponsor.js +++ b/src/pages/sponsor/sponsor.js @@ -85,6 +85,9 @@ export default function Sponsor(onclose) { try { const res = await fetch(`${config.API_BASE}/sponsor`, { method: "POST", + headers: { + "Content-Type": "application/json", + }, body: JSON.stringify({ ...sponsorDetails, tier: productId,