mirror of
https://github.com/formbricks/formbricks.git
synced 2026-02-22 06:50:15 -06:00
fix: adds no-cache header when debug mode is ON (#5405)
This commit is contained in:
@@ -12,13 +12,12 @@ export const makeRequest = async <T>(
|
||||
): Promise<Result<T, ApiErrorResponse>> => {
|
||||
const url = new URL(appUrl + endpoint);
|
||||
const body = data ? JSON.stringify(data) : undefined;
|
||||
|
||||
const res = await wrapThrowsAsync(fetch)(url.toString(), {
|
||||
method,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
...(isDebug && { "Cache-Control": "no-cache" }),
|
||||
},
|
||||
...(isDebug && { "Cache-Control": "no-cache" }),
|
||||
body,
|
||||
});
|
||||
|
||||
|
||||
@@ -164,8 +164,8 @@ describe("api.ts", () => {
|
||||
method: "GET",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
"Cache-Control": "no-cache",
|
||||
},
|
||||
"Cache-Control": "no-cache",
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -17,8 +17,8 @@ export const makeRequest = async <T>(
|
||||
method,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
...(isDebug && { "Cache-Control": "no-cache" }),
|
||||
},
|
||||
...(isDebug && { "Cache-Control": "no-cache" }),
|
||||
body,
|
||||
});
|
||||
|
||||
|
||||
@@ -164,8 +164,8 @@ describe("api.ts", () => {
|
||||
method: "GET",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
"Cache-Control": "no-cache",
|
||||
},
|
||||
"Cache-Control": "no-cache",
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user