Prevent autoupdate from Cordova apps built with Meteor < 1.3

Not setting the Access-Control-Allow-Origin header avoids Cordova apps
built with Meteor < 1.3 from downloading manifest.json and thus blocks
autoupdate.
This commit is contained in:
Martijn Walraven
2016-03-16 13:59:31 +01:00
parent 9cf9bc5ff2
commit ea6951122e

View File

@@ -403,10 +403,6 @@ WebAppInternals.staticFilesMiddleware = function (staticFiles, req, res, next) {
res.setHeader("Content-Type", "text/css; charset=UTF-8");
} else if (info.type === "json") {
res.setHeader("Content-Type", "application/json; charset=UTF-8");
// XXX if it is a manifest we are serving, set additional headers
if (/\/manifest\.json$/.test(pathname)) {
res.setHeader("Access-Control-Allow-Origin", "*");
}
}
if (info.hash) {