diff --git a/packages/dynamic-import/client.js b/packages/dynamic-import/client.js index 298f61e69f..d34aef856f 100644 --- a/packages/dynamic-import/client.js +++ b/packages/dynamic-import/client.js @@ -121,7 +121,11 @@ var fetchURL = require("./common.js").fetchURL; function fetchMissing(missingTree) { return new Promise(function (resolve, reject) { - HTTP.call("POST", Meteor.absoluteUrl(fetchURL), { + // Always match the protocol (http or https) and the domain:port of + // the current page. + var url = "//" + location.host + fetchURL; + + HTTP.call("POST", url, { query: secretKey ? "key=" + secretKey : void 0, data: missingTree }, function (error, result) {