From 240e3f0e87e4afd0bb6716374cd3a408775c2950 Mon Sep 17 00:00:00 2001 From: Evan Steinkerchner Date: Tue, 19 Apr 2022 20:24:51 -0400 Subject: Changed config and header names as per @bastienwirtz feedback --- src/mixins/service.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/mixins/service.js b/src/mixins/service.js index b47f756..b8c2cdc 100644 --- a/src/mixins/service.js +++ b/src/mixins/service.js @@ -3,6 +3,7 @@ const merge = require("lodash.merge"); export default { props: { proxy: Object, + forwarder: Object, }, created: function () { // custom service often consume info from an API using the item link (url) as a base url, @@ -27,9 +28,9 @@ export default { this.item.useCredentials === true ? "include" : "omit"; } - if (this.proxy?.apikey) { + if (this.forwarder?.apikey) { options.headers = { - "X-Homer-Api-Key": this.proxy.apikey, + "X-Homer-Forwarder-Api-Key": this.forwarder.apikey, }; } @@ -39,12 +40,12 @@ export default { let url = path ? `${this.endpoint}/${path}` : this.endpoint; - if (this.proxy?.url) { + if (this.forwarder?.url) { options.headers = { ...(options.headers || {}), - "X-Homer-Api-Url": url, + "X-Homer-Forwarder-Url": url, }; - url = this.proxy.url; + url = this.forwarder.url; } options = merge(options, init); -- cgit v1.2.3