Merge pull request #2478 from influxdata/bugfix/logging-cookies
Fix headers sent to Kapacitor proxy endpoint by clientside fetchpull/2450/head^2
commit
58a8c69ec4
|
@ -101,10 +101,16 @@ export const updateTask = async (
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const kapacitorLogHeaders = {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
Accept: 'application/json',
|
||||||
|
}
|
||||||
|
|
||||||
export const getLogStream = kapacitor =>
|
export const getLogStream = kapacitor =>
|
||||||
fetch(`${kapacitor.links.proxy}?path=/kapacitor/v1preview/logs`, {
|
fetch(`${kapacitor.links.proxy}?path=/kapacitor/v1preview/logs`, {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
headers: {'Content-Type': 'application/json'},
|
headers: kapacitorLogHeaders,
|
||||||
|
credentials: 'include',
|
||||||
})
|
})
|
||||||
|
|
||||||
export const getLogStreamByRuleID = (kapacitor, ruleID) =>
|
export const getLogStreamByRuleID = (kapacitor, ruleID) =>
|
||||||
|
@ -112,7 +118,8 @@ export const getLogStreamByRuleID = (kapacitor, ruleID) =>
|
||||||
`${kapacitor.links.proxy}?path=/kapacitor/v1preview/logs?task=${ruleID}`,
|
`${kapacitor.links.proxy}?path=/kapacitor/v1preview/logs?task=${ruleID}`,
|
||||||
{
|
{
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
headers: {'Content-Type': 'application/json'},
|
headers: kapacitorLogHeaders,
|
||||||
|
credentials: 'include',
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -121,6 +128,8 @@ export const pingKapacitorVersion = async kapacitor => {
|
||||||
const result = await AJAX({
|
const result = await AJAX({
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
url: `${kapacitor.links.proxy}?path=/kapacitor/v1preview/ping`,
|
url: `${kapacitor.links.proxy}?path=/kapacitor/v1preview/ping`,
|
||||||
|
headers: kapacitorLogHeaders,
|
||||||
|
credentials: 'include',
|
||||||
})
|
})
|
||||||
const kapVersion = result.headers['x-kapacitor-version']
|
const kapVersion = result.headers['x-kapacitor-version']
|
||||||
return kapVersion === '' ? null : kapVersion
|
return kapVersion === '' ? null : kapVersion
|
||||||
|
|
Loading…
Reference in New Issue