fix: empty / null headers issue

This commit is contained in:
Bastien Wirtz 2024-10-27 14:40:43 +01:00
parent 95f1d94219
commit b168430fbf
2 changed files with 3 additions and 2 deletions

View File

@ -55,6 +55,7 @@ within Homer:
url: "http://my-service-link"
endpoint: "http://my-service-endpoint" # Optional: alternative base URL used to fetch service data is necessary.
useCredentials: false # Optional: Override global proxy.useCredentials configuration.
headers: # Optional: Override global proxy.headers configuration.
type: "<type>"
```

View File

@ -19,7 +19,7 @@ export default {
options.credentials = "include";
}
if (this.proxy?.headers) {
if (this.proxy?.headers && !!this.proxy.headers) {
options.headers = this.proxy.headers;
}
@ -30,7 +30,7 @@ export default {
}
// Each item can have their own headers
if (this.item.headers !== undefined) {
if (this.item.headers !== undefined && !!this.item.headers) {
options.headers = this.item.headers;
}