mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-20 00:08:02 +01:00
Include credentials in all mutating fetch requests.
This commit is contained in:
parent
ac0a9f5230
commit
58cc3cf1ef
@ -13,6 +13,7 @@ function revive (feature) {
|
|||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers,
|
headers,
|
||||||
body: JSON.stringify(feature),
|
body: JSON.stringify(feature),
|
||||||
|
credentials: 'include',
|
||||||
}).then(throwIfNotSuccess);
|
}).then(throwIfNotSuccess);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,6 +24,7 @@ function create (featureToggle) {
|
|||||||
.then(() => fetch(URI, {
|
.then(() => fetch(URI, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers,
|
headers,
|
||||||
|
credentials: 'include',
|
||||||
body: JSON.stringify(featureToggle),
|
body: JSON.stringify(featureToggle),
|
||||||
}))
|
}))
|
||||||
.then(throwIfNotSuccess);
|
.then(throwIfNotSuccess);
|
||||||
@ -33,6 +34,7 @@ function validate (featureToggle) {
|
|||||||
return fetch(URI_VALIDATE, {
|
return fetch(URI_VALIDATE, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers,
|
headers,
|
||||||
|
credentials: 'include',
|
||||||
body: JSON.stringify(featureToggle),
|
body: JSON.stringify(featureToggle),
|
||||||
}).then(throwIfNotSuccess);
|
}).then(throwIfNotSuccess);
|
||||||
}
|
}
|
||||||
@ -42,6 +44,7 @@ function update (featureToggle) {
|
|||||||
.then(() => fetch(`${URI}/${featureToggle.name}`, {
|
.then(() => fetch(`${URI}/${featureToggle.name}`, {
|
||||||
method: 'PUT',
|
method: 'PUT',
|
||||||
headers,
|
headers,
|
||||||
|
credentials: 'include',
|
||||||
body: JSON.stringify(featureToggle),
|
body: JSON.stringify(featureToggle),
|
||||||
}))
|
}))
|
||||||
.then(throwIfNotSuccess);
|
.then(throwIfNotSuccess);
|
||||||
@ -50,6 +53,7 @@ function update (featureToggle) {
|
|||||||
function remove (featureToggleName) {
|
function remove (featureToggleName) {
|
||||||
return fetch(`${URI}/${featureToggleName}`, {
|
return fetch(`${URI}/${featureToggleName}`, {
|
||||||
method: 'DELETE',
|
method: 'DELETE',
|
||||||
|
credentials: 'include',
|
||||||
}).then(throwIfNotSuccess);
|
}).then(throwIfNotSuccess);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,6 +13,7 @@ function create (strategy) {
|
|||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers,
|
headers,
|
||||||
body: JSON.stringify(strategy),
|
body: JSON.stringify(strategy),
|
||||||
|
credentials: 'include',
|
||||||
}).then(throwIfNotSuccess);
|
}).then(throwIfNotSuccess);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -20,6 +21,7 @@ function remove (strategy) {
|
|||||||
return fetch(`${URI}/${strategy.name}`, {
|
return fetch(`${URI}/${strategy.name}`, {
|
||||||
method: 'DELETE',
|
method: 'DELETE',
|
||||||
headers,
|
headers,
|
||||||
|
credentials: 'include',
|
||||||
}).then(throwIfNotSuccess);
|
}).then(throwIfNotSuccess);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user