Skip to content

Commit

Permalink
headers
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeyTheA committed Jun 22, 2024
1 parent f9fab2f commit e163faf
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,17 @@ export function apiFetch(path: string, authed: boolean = false): Promise<Respons
request["headers"] = { "Authorization": sId };
}
}

if (request["headers"]) {
request["headers"]["Origin"] = "https://pokerogue.net";
request["headers"]["Referer"] = "https://pokerogue.net";
} else {
request["headers"] = {
Origin: "https://pokerogue.net",
Referer: "https://pokerogue.net",
};
}

fetch(`${apiUrl}/${path}`, request)
.then(response => resolve(response))
.catch(err => reject(err));
Expand Down

0 comments on commit e163faf

Please sign in to comment.