diff options
-rw-r--r-- | src/mixins/service.js | 11 |
1 files 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"); | |||
3 | export default { | 3 | export default { |
4 | props: { | 4 | props: { |
5 | proxy: Object, | 5 | proxy: Object, |
6 | forwarder: Object, | ||
6 | }, | 7 | }, |
7 | created: function () { | 8 | created: function () { |
8 | // custom service often consume info from an API using the item link (url) as a base url, | 9 | // custom service often consume info from an API using the item link (url) as a base url, |
@@ -27,9 +28,9 @@ export default { | |||
27 | this.item.useCredentials === true ? "include" : "omit"; | 28 | this.item.useCredentials === true ? "include" : "omit"; |
28 | } | 29 | } |
29 | 30 | ||
30 | if (this.proxy?.apikey) { | 31 | if (this.forwarder?.apikey) { |
31 | options.headers = { | 32 | options.headers = { |
32 | "X-Homer-Api-Key": this.proxy.apikey, | 33 | "X-Homer-Forwarder-Api-Key": this.forwarder.apikey, |
33 | }; | 34 | }; |
34 | } | 35 | } |
35 | 36 | ||
@@ -39,12 +40,12 @@ export default { | |||
39 | 40 | ||
40 | let url = path ? `${this.endpoint}/${path}` : this.endpoint; | 41 | let url = path ? `${this.endpoint}/${path}` : this.endpoint; |
41 | 42 | ||
42 | if (this.proxy?.url) { | 43 | if (this.forwarder?.url) { |
43 | options.headers = { | 44 | options.headers = { |
44 | ...(options.headers || {}), | 45 | ...(options.headers || {}), |
45 | "X-Homer-Api-Url": url, | 46 | "X-Homer-Forwarder-Url": url, |
46 | }; | 47 | }; |
47 | url = this.proxy.url; | 48 | url = this.forwarder.url; |
48 | } | 49 | } |
49 | 50 | ||
50 | options = merge(options, init); | 51 | options = merge(options, init); |