1
0
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:
ivaosthu 2016-11-24 21:58:42 +01:00
parent ac0a9f5230
commit 58cc3cf1ef
3 changed files with 7 additions and 0 deletions

View File

@ -13,6 +13,7 @@ function revive (feature) {
method: 'POST',
headers,
body: JSON.stringify(feature),
credentials: 'include',
}).then(throwIfNotSuccess);
}

View File

@ -24,6 +24,7 @@ function create (featureToggle) {
.then(() => fetch(URI, {
method: 'POST',
headers,
credentials: 'include',
body: JSON.stringify(featureToggle),
}))
.then(throwIfNotSuccess);
@ -33,6 +34,7 @@ function validate (featureToggle) {
return fetch(URI_VALIDATE, {
method: 'POST',
headers,
credentials: 'include',
body: JSON.stringify(featureToggle),
}).then(throwIfNotSuccess);
}
@ -42,6 +44,7 @@ function update (featureToggle) {
.then(() => fetch(`${URI}/${featureToggle.name}`, {
method: 'PUT',
headers,
credentials: 'include',
body: JSON.stringify(featureToggle),
}))
.then(throwIfNotSuccess);
@ -50,6 +53,7 @@ function update (featureToggle) {
function remove (featureToggleName) {
return fetch(`${URI}/${featureToggleName}`, {
method: 'DELETE',
credentials: 'include',
}).then(throwIfNotSuccess);
}

View File

@ -13,6 +13,7 @@ function create (strategy) {
method: 'POST',
headers,
body: JSON.stringify(strategy),
credentials: 'include',
}).then(throwIfNotSuccess);
}
@ -20,6 +21,7 @@ function remove (strategy) {
return fetch(`${URI}/${strategy.name}`, {
method: 'DELETE',
headers,
credentials: 'include',
}).then(throwIfNotSuccess);
}