Skip to content
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
* @property {string} [baseURL] a base URL from which to resolve all URLs
* @property {typeof window.fetch} [fetch] Custom window.fetch implementation
* @property {any} [data]
* @property {RequestMode} [mode] The mode of the request (e.g., cors, no-cors, same-origin, or navigate.). Defaults to cors.
*/

/**
Expand Down Expand Up @@ -199,7 +200,8 @@ export default (function create(/** @type {Options} */ defaults) {
method: _method || options.method,
body: data,
headers: deepMerge(options.headers, customHeaders, true),
credentials: options.withCredentials ? 'include' : 'same-origin'
credentials: options.withCredentials ? 'include' : 'same-origin',
mode: options.mode ? options.mode : 'cors'
}).then((res) => {
for (const i in res) {
if (typeof res[i] != 'function') response[i] = res[i];
Expand Down