mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Support query parameter to avoid downloading index page when a file does not exist
When downloading files during a Cordova hot code push, we need to detect if a file is not available instead of inadvertently downloading the default index page.
This commit is contained in:
@@ -685,6 +685,17 @@ var runWebAppServer = function () {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
if (request.url.query && request.url.query['meteor_dont_serve_index']) {
|
||||
// When downloading files during a Cordova hot code push, we need
|
||||
// to detect if a file is not available instead of inadvertently
|
||||
// downloading the default index page.
|
||||
// So similar to the situation above, we serve an uncached 404.
|
||||
headers['Cache-Control'] = 'no-cache';
|
||||
res.writeHead(404, headers);
|
||||
res.end("404 Not Found");
|
||||
return undefined;
|
||||
}
|
||||
|
||||
// /packages/asdfsad ... /__cordova/dafsdf.js
|
||||
var pathname = connect.utils.parseUrl(req).pathname;
|
||||
var archKey = pathname.split('/')[1];
|
||||
|
||||
Reference in New Issue
Block a user