Skip to content

Commit

Permalink
Use application/json in all requests
Browse files Browse the repository at this point in the history
  • Loading branch information
ChiriVulpes committed Mar 31, 2024
1 parent 847a8e9 commit 61ff88f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Fluff4me.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ export default class Fluff4me {
method: "POST",
credentials: "include",
headers: {
"Accept": "application/json",
"Content-Type": "application/json",
},
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
Expand All @@ -92,6 +93,7 @@ export default class Fluff4me {
credentials: "include",
headers: {
"Content-Type": "application/json",
"Accept": "application/json",
},
body: JSON.stringify({
name: "Chiri Vulpes",
Expand All @@ -111,6 +113,7 @@ export default class Fluff4me {
method: "POST",
credentials: "include",
headers: {
"Accept": "application/json",
"Content-Type": "application/json",
},
}));
Expand All @@ -137,6 +140,7 @@ export default class Fluff4me {
method: "POST",
credentials: "include",
headers: {
"Accept": "application/json",
"Content-Type": "application/json",
},
body: JSON.stringify({
Expand All @@ -154,7 +158,9 @@ export default class Fluff4me {

namespace Session {
export async function refresh (response?: Response) {
const headers: HeadersInit = {};
const headers: HeadersInit = {
"Accept": "application/json",
};
response ??= await fetch(`${Env.API_ORIGIN}session`, { headers, credentials: "include" });
const stateToken = response.headers.get("State-Token");
if (stateToken)
Expand Down

0 comments on commit 61ff88f

Please sign in to comment.