From 850720be2a6dc926b13230f88f99286e6e7c5e21 Mon Sep 17 00:00:00 2001 From: andrewkfiedler Date: Thu, 7 May 2020 19:56:08 -0700 Subject: [PATCH 1/2] Update fetch to always send creentials --- package.json | 2 +- src/main/webapp/components/fetch/base-fetch.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 5897fe9..3d2e571 100644 --- a/package.json +++ b/package.json @@ -96,5 +96,5 @@ ] }, "main": "src/main/webapp/components/entry/default-entry.tsx", - "context-path": "/" + "context-path": "./" } diff --git a/src/main/webapp/components/fetch/base-fetch.tsx b/src/main/webapp/components/fetch/base-fetch.tsx index 00b3fb4..c987cdc 100644 --- a/src/main/webapp/components/fetch/base-fetch.tsx +++ b/src/main/webapp/components/fetch/base-fetch.tsx @@ -55,7 +55,7 @@ export type FetchProps = (url: string, options?: Options) => Promise const customFetch: FetchProps = (url, allOptions = {}) => { const { headers, ...otherOptions } = allOptions return fetch(cacheBust(url), { - credentials: 'same-origin', + credentials: 'include', cache: 'no-cache', ...otherOptions, headers: { From 86762807ae64e6ab6e6a05880fc88a408af5fad9 Mon Sep 17 00:00:00 2001 From: andrewkfiedler Date: Fri, 8 May 2020 12:20:26 -0700 Subject: [PATCH 2/2] test removing header --- src/main/webapp/components/fetch/base-fetch.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/webapp/components/fetch/base-fetch.tsx b/src/main/webapp/components/fetch/base-fetch.tsx index c987cdc..684f851 100644 --- a/src/main/webapp/components/fetch/base-fetch.tsx +++ b/src/main/webapp/components/fetch/base-fetch.tsx @@ -59,7 +59,7 @@ const customFetch: FetchProps = (url, allOptions = {}) => { cache: 'no-cache', ...otherOptions, headers: { - 'X-Requested-With': 'XMLHttpRequest', + // 'X-Requested-With': 'XMLHttpRequest', ...headers, }, })