Merge pull request #3600 from overleaf/ae-credentials-same-origin

Explicitly set credentials: same-origin on fetch requests

GitOrigin-RevId: 17204554f560e2a04b35c631f571fd73f91efadd
This commit is contained in:
Miguel Serrano
2021-01-28 03:05:13 +00:00
committed by Copybot
parent ba6c74b2d6
commit 1036708e0e
@@ -23,7 +23,13 @@ export function deleteJSON(path, options) {
function fetchJSON(
path,
{ body = {}, headers = {}, method = 'GET', ...otherOptions }
{
body = {},
headers = {},
method = 'GET',
credentials = 'same-origin',
...otherOptions
}
) {
const options = {
...otherOptions,
@@ -33,6 +39,7 @@ function fetchJSON(
'X-Csrf-Token': window.csrfToken,
Accept: 'application/json'
},
credentials,
method
}