diff --git a/docs/configuration.md b/docs/configuration.md index 15976ea..c1c366e 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -31,6 +31,10 @@ connectivityCheck: true # whether you want to display a message when the apps ar # Optional: Proxy / hosting option proxy: useCredentials: false # send cookies & authorization headers when fetching service specific data. Set to `true` if you use an authentication proxy. Can be overrided on service level. + headers: # send custom headers when fetching service specific data. Can also be set on a service level. + Test: "Example" + Test1: "Example1" + # Set the default layout and color scheme defaults: diff --git a/src/mixins/service.js b/src/mixins/service.js index 64c7f05..1e29a24 100644 --- a/src/mixins/service.js +++ b/src/mixins/service.js @@ -19,12 +19,21 @@ export default { options.credentials = "include"; } + if (this.proxy?.headers) { + options.headers = this.proxy.headers; + } + // Each item can override the credential settings if (this.item.useCredentials !== undefined) { options.credentials = this.item.useCredentials === true ? "include" : "omit"; } + // Each item can have their own headers + if (this.item.headers !== undefined) { + options.headers = this.item.headers; + } + options = Object.assign(options, init); if (path.startsWith("/")) {