Updates
This commit is contained in:
@@ -49,14 +49,15 @@ export default async function fetchApi<
|
||||
): Promise<R> {
|
||||
let data;
|
||||
|
||||
const csrfValue = localStorage.getItem(localStorageCSRFKey || "csrf");
|
||||
const csrfKey = "x-dsql-csrf-key";
|
||||
const csrfValue = localStorage.getItem(localStorageCSRFKey || csrfKey);
|
||||
|
||||
let finalHeaders = {
|
||||
"Content-Type": "application/json",
|
||||
} as FetchHeader;
|
||||
|
||||
if (csrf && csrfValue) {
|
||||
finalHeaders[csrfHeaderKey || "x-csrf-key"] = csrfValue;
|
||||
finalHeaders[localStorageCSRFKey || csrfKey] = csrfValue;
|
||||
}
|
||||
|
||||
if (typeof options === "string") {
|
||||
|
||||
Reference in New Issue
Block a user