Skip to content

Commit 6820579

Browse files
author
Cookiezaurs
committed
[core] Fixes for license installer script
1 parent a931f5e commit 6820579

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

bin/scripts/license_installer.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,10 @@ pluginManager.dbConnection(DB).then(async(countlyDb) => {
5858
try {
5959
let apiDomain = (await countlyDb.collection('plugins').findOne({ _id: 'plugins' }, { _id: 0, 'api.domain': 1 })).api.domain.split('//')[1];
6060
apiDomain = apiDomain.replace(/(^\w+:|^)\/\//, '').replace(/\/$/, '');
61-
let { body } = await httpRequest(`https://stats.count.ly/o/license-generator/list?app_id=633b1796ff6957bdc9360aef&iDisplayStart=0&iDisplayLength=1&iSortCol_0=3&sSortDir_0=desc&query={"domain":{"$regex":"${apiDomain}"}}`, { method: 'POST' }, { auth_token: auth_token });
61+
if (apiDomain.indexOf("www.") === 0) {
62+
apiDomain = apiDomain.substring(4);
63+
}
64+
let { body } = await httpRequest(`https://stats.count.ly/o/license-generator/list?app_id=633b1796ff6957bdc9360aef&iDisplayStart=0&iDisplayLength=1&iSortCol_0=3&sSortDir_0=desc&query={"domain":{"$regex":"^${apiDomain}"}}`, { method: 'POST' }, { auth_token: auth_token });
6265
body = JSON.parse(body);
6366
let licenseId = '';
6467
if (body?.aaData?.length) {

0 commit comments

Comments
 (0)