Correctly set the credentials of a fetch request, when the withCredentials parameter was passed to getDocument

Skimming through https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch#Sending_a_request_with_credentials_included, it looks to me like the `credentials` option was accidentally inverted.
This commit is contained in:
Jonas Jenwald 2017-08-31 09:03:22 +02:00
parent a4cc85fc5f
commit 84fe442b35

View File

@ -26,7 +26,7 @@ function createFetchOptions(headers, withCredentials) {
method: 'GET',
headers,
mode: 'cors',
credentials: withCredentials ? 'omit' : 'include',
credentials: withCredentials ? 'include' : 'omit',
redirect: 'follow',
};
}