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',
|
||||
headers,
|
||||
body: JSON.stringify(feature),
|
||||
credentials: 'include',
|
||||
}).then(throwIfNotSuccess);
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user