diff --git a/package-lock.json b/package-lock.json index 59666b1..2c9d909 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "squishjs", - "version": "1.0.10", + "version": "1.0.11", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "squishjs", - "version": "1.0.10", + "version": "1.0.11", "license": "ISC" } } diff --git a/package.json b/package.json index 3300832..9a97535 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "squishjs", - "version": "1.0.10", + "version": "1.0.11", "description": "squish & unsquish stuff", "scripts": { "test": "node testRunner.js" diff --git a/src/Asset.js b/src/Asset.js index 4c5b724..89b1483 100644 --- a/src/Asset.js +++ b/src/Asset.js @@ -157,14 +157,17 @@ class Asset { const filePath = `${path}/${fileHash}`; const writeStream = this.fs.createWriteStream(filePath); - const getModule = this.https; writeStream.on('close', () => { resolve(filePath); }); let data = ''; - getModule.get(`https://assets.homegames.io/${assetId}`, (res) => { + const assetSource = this.info?.source? || 'https://assets.homegames.io'; + + const getModule = assetSource.startsWith('https') ? this.https : this.http; + + getModule.get(`${assetSource}/${assetId}`, (res) => { res.on('data', (chunk) => { data += chunk; writeStream.write(chunk);