Skip to content

Commit 580b606

Browse files
author
Ajit Kumar
committed
fix: API calls throwing internal server errors
1 parent d7b549a commit 580b606

4 files changed

Lines changed: 15 additions & 0 deletions

File tree

src/lib/acode.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -658,6 +658,9 @@ class Acode {
658658
const purchase = await getPurchase(product.productId);
659659
await fetch(Url.join(config.API_BASE, "plugin/order"), {
660660
method: "POST",
661+
headers: {
662+
"Content-Type": "application/json",
663+
},
661664
body: JSON.stringify({
662665
id: remotePlugin.id,
663666
token: purchase?.purchaseToken,

src/lib/installPlugin.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,9 @@ async function resolveDep(manifest) {
470470
const purchase = await getPurchase(product.productId);
471471
await fetch(Url.join(config.API_BASE, "plugin/order"), {
472472
method: "POST",
473+
headers: {
474+
"Content-Type": "application/json",
475+
},
473476
body: JSON.stringify({
474477
id: manifest.id,
475478
token: purchase?.purchaseToken,

src/pages/plugin/plugin.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,9 @@ export default async function PluginInclude(
323323
const purchase = await getPurchase(product.productId);
324324
await fetch(Url.join(config.API_BASE, "plugin/order"), {
325325
method: "POST",
326+
headers: {
327+
"Content-Type": "application/json",
328+
},
326329
body: JSON.stringify({
327330
id: plugin.id,
328331
token: purchase?.purchaseToken,
@@ -382,6 +385,9 @@ export default async function PluginInclude(
382385
$button.textContent = strings["loading..."];
383386
const res = await fetch(Url.join(config.API_BASE, "plugin/refund"), {
384387
method: "POST",
388+
headers: {
389+
"Content-Type": "application/json",
390+
},
385391
body: JSON.stringify({
386392
id: plugin.id,
387393
package: BuildInfo.packageName,

src/pages/sponsor/sponsor.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@ export default function Sponsor(onclose) {
8585
try {
8686
const res = await fetch(`${config.API_BASE}/sponsor`, {
8787
method: "POST",
88+
headers: {
89+
"Content-Type": "application/json",
90+
},
8891
body: JSON.stringify({
8992
...sponsorDetails,
9093
tier: productId,

0 commit comments

Comments
 (0)