fix(ui): pass credentials when sending silences to alertmanager

Fixes #484
This commit is contained in:
Łukasz Mierzwa
2019-03-01 19:18:48 +00:00
parent 0d6505777b
commit a41c07bcee
2 changed files with 6 additions and 2 deletions

View File

@@ -141,7 +141,10 @@ const DeleteSilenceModalContent = observer(
if (this.deleteState.done && this.deleteState.error === null) return;
const uri = `${alertmanager.publicURI}/api/v1/silence/${silenceID}`;
this.deleteState.fetch = fetch(uri, { method: "DELETE" })
this.deleteState.fetch = fetch(uri, {
method: "DELETE",
credentials: "include"
})
.then(result => result.json())
.then(result => this.parseAlertmanagerResponse(result))
.catch(err => {

View File

@@ -104,7 +104,8 @@ const SilenceSubmitProgress = observer(
body: JSON.stringify(payload),
headers: {
"Content-Type": "application/json"
}
},
credentials: "include"
})
.then(result => result.json())
.then(result => this.parseAlertmanagerResponse(am.uri, result))