mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Revert "Use Meteor.absoluteUrl again in dynamic-import fetchMissing function."
This reverts commit 3b77bb5197.
Should fix #9888.
Sending dynamic import() requests to any origin other than location.host
causes some browsers to send a preflight CORS request ( method:OPTIONS) to
verify that the server allows the request, which was causing problems
because the dynamic import() server expects method:POST.
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user