mirror of
https://github.com/bastienwirtz/homer.git
synced 2024-11-07 08:44:00 +01:00
Add the option to set custom headers in the SW
This commit is contained in:
parent
bbc88262ee
commit
95f1d94219
@ -31,6 +31,10 @@ connectivityCheck: true # whether you want to display a message when the apps ar
|
|||||||
# Optional: Proxy / hosting option
|
# Optional: Proxy / hosting option
|
||||||
proxy:
|
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.
|
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
|
# Set the default layout and color scheme
|
||||||
defaults:
|
defaults:
|
||||||
|
@ -19,12 +19,21 @@ export default {
|
|||||||
options.credentials = "include";
|
options.credentials = "include";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.proxy?.headers) {
|
||||||
|
options.headers = this.proxy.headers;
|
||||||
|
}
|
||||||
|
|
||||||
// Each item can override the credential settings
|
// Each item can override the credential settings
|
||||||
if (this.item.useCredentials !== undefined) {
|
if (this.item.useCredentials !== undefined) {
|
||||||
options.credentials =
|
options.credentials =
|
||||||
this.item.useCredentials === true ? "include" : "omit";
|
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);
|
options = Object.assign(options, init);
|
||||||
|
|
||||||
if (path.startsWith("/")) {
|
if (path.startsWith("/")) {
|
||||||
|
Loading…
Reference in New Issue
Block a user