fix: 🐛 support metadata access on another API host (#1682)
This commit is contained in:
1 parent
041990322f
commit
5723d8efb5
1 file changed
+6
-1
@@ -7,14 +7,19 @@ import fetch from 'fetch';
|
|||||||
|
|
||||||
async function autoInitializeFeatureEdition(owner) {
|
async function autoInitializeFeatureEdition(owner) {
|
||||||
const service = owner.lookup('service:feature-edition');
|
const service = owner.lookup('service:feature-edition');
|
||||||
const url = '/metadata.json';
|
const adapter = owner.lookup('adapter:application');
|
||||||
|
|
||||||
let edition;
|
let edition;
|
||||||
let features;
|
let features;
|
||||||
|
|
||||||
// Attempt to load edition for the metadata JSON
|
// Attempt to load edition for the metadata JSON
|
||||||
try {
|
try {
|
||||||
|
const { host } = adapter;
|
||||||
|
const path = '/metadata.json';
|
||||||
|
const url = `${host}${path}`;
|
||||||
const response = await fetch(url);
|
const response = await fetch(url);
|
||||||
const json = await response.json();
|
const json = await response.json();
|
||||||
|
|
||||||
edition = json?.license?.edition;
|
edition = json?.license?.edition;
|
||||||
features = json?.license?.features;
|
features = json?.license?.features;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|||||||
Reference in new issue
Block a user