diff --git a/src/index.js b/src/index.js index f4c86f2..792f758 100644 --- a/src/index.js +++ b/src/index.js @@ -142,7 +142,7 @@ export default (function create(defaults) { } } } - + const fetchFunc = options.fetch || fetch; const customHeaders = {}; @@ -172,7 +172,8 @@ export default (function create(defaults) { return fetchFunc(url, { method: options.method, body: data, - headers: deepMerge(options.headers, customHeaders, true) + headers: deepMerge(options.headers, customHeaders, true), + credentials: options.withCredentials && 'include' }).then((res) => { let i; for (i in res) {