console
console copied to clipboard
How to consume getConsoleRequestHeaders?
I see it listed in the API docs but it's not being exported in the code for public use nor is it being used anywhere other than internal use cases, am I missing something?
https://github.com/openshift/console/blob/618cb2562170df662dc0a5ae01cc4fb8858b482b/frontend/packages/console-dynamic-plugin-sdk/docs/api.md#getconsolerequestheaders
Any help would be much appreciated thank you.
I would not expect you to need to use this directly if you use the various kubernetes utilities in the API, which already add these headers. This might have been exposed unintentionally.
cc @christianvogt @vojtechszocs @florkbr
Yeah the reason this is needed/useful is when your dynamic plugin codebase use Axios instead of fetch, one could just add this "headers: getConsoleRequestHeaders()" in your axios.create({}) global configuration and you wouldn't need to change your API calls to use fetch.
I found a workaround by wrapping consoleFetch responses to output an axios-like format, like an adapter, it works but feels like a hack.
Issues go stale after 90d of inactivity.
Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.
If this issue is safe to close now please do so with /close.
/lifecycle stale
Stale issues rot after 30d of inactivity.
Mark the issue as fresh by commenting /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.
Exclude this issue from closing by commenting /lifecycle frozen.
If this issue is safe to close now please do so with /close.
/lifecycle rotten /remove-lifecycle stale