fix the rest of the deprecation warnings
This commit is contained in:
parent
6fad2ca39a
commit
fd1d285a77
6 changed files with 8 additions and 8 deletions
|
@ -303,7 +303,7 @@ exports.doImport = function(req, res, padId)
|
|||
var impexp = window.parent.padimpexp.handleFrameCall('" + directDatabaseAccess +"', '" + status + "'); \
|
||||
}) \
|
||||
</script>"
|
||||
, 200);
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ exports.expressCreateServer = function (hook_name, args, cb) {
|
|||
// if an error occurs Connect will pass it down
|
||||
// through these "error-handling" middleware
|
||||
// allowing you to respond however you like
|
||||
res.send(500, { error: 'Sorry, something bad happened!' });
|
||||
res.status(500).send({ error: 'Sorry, something bad happened!' });
|
||||
console.error(err.stack? err.stack : err.toString());
|
||||
stats.meter('http500').mark()
|
||||
})
|
||||
|
@ -50,4 +50,4 @@ exports.expressCreateServer = function (hook_name, args, cb) {
|
|||
//https://github.com/joyent/node/issues/1553
|
||||
process.on('SIGINT', exports.gracefulShutdown);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@ exports.expressCreateServer = function (hook_name, args, cb) {
|
|||
ERR(err);
|
||||
|
||||
if(err == "notfound")
|
||||
res.send(404, '404 - Not Found');
|
||||
res.status(404).send('404 - Not Found');
|
||||
else
|
||||
res.send(html);
|
||||
});
|
||||
|
|
|
@ -7,7 +7,7 @@ exports.expressCreateServer = function (hook_name, args, cb) {
|
|||
//ensure the padname is valid and the url doesn't end with a /
|
||||
if(!padManager.isValidPadId(padId) || /\/$/.test(req.url))
|
||||
{
|
||||
res.send(404, 'Such a padname is forbidden');
|
||||
res.status(404).send('Such a padname is forbidden');
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -19,7 +19,7 @@ exports.expressCreateServer = function (hook_name, args, cb) {
|
|||
var query = url.parse(req.url).query;
|
||||
if ( query ) real_url += '?' + query;
|
||||
res.header('Location', real_url);
|
||||
res.send(302, 'You should be redirected to <a href="' + real_url + '">' + real_url + '</a>');
|
||||
res.status(302).send('You should be redirected to <a href="' + real_url + '">' + real_url + '</a>');
|
||||
}
|
||||
//the pad id was fine, so just render it
|
||||
else
|
||||
|
|
|
@ -91,7 +91,7 @@ exports.expressCreateServer = function(n, args) {
|
|||
res.setHeader('Content-Type', 'application/json; charset=utf-8');
|
||||
res.send('{"'+locale+'":'+JSON.stringify(locales[locale])+'}');
|
||||
} else {
|
||||
res.send(404, 'Language not available');
|
||||
res.status(404).send('Language not available');
|
||||
}
|
||||
})
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ module.exports = function (req, res, callback) {
|
|||
callback();
|
||||
//no access
|
||||
} else {
|
||||
res.send(403, "403 - Can't touch this");
|
||||
res.status(403).send("403 - Can't touch this");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue