fix the rest of the deprecation warnings

This commit is contained in:
Tom Hunkapiller 2015-04-10 14:10:55 -05:00
parent 6fad2ca39a
commit fd1d285a77
6 changed files with 8 additions and 8 deletions

View file

@ -303,7 +303,7 @@ exports.doImport = function(req, res, padId)
var impexp = window.parent.padimpexp.handleFrameCall('" + directDatabaseAccess +"', '" + status + "'); \ var impexp = window.parent.padimpexp.handleFrameCall('" + directDatabaseAccess +"', '" + status + "'); \
}) \ }) \
</script>" </script>"
, 200); );
}); });
} }

View file

@ -39,7 +39,7 @@ exports.expressCreateServer = function (hook_name, args, cb) {
// if an error occurs Connect will pass it down // if an error occurs Connect will pass it down
// through these "error-handling" middleware // through these "error-handling" middleware
// allowing you to respond however you like // 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()); console.error(err.stack? err.stack : err.toString());
stats.meter('http500').mark() stats.meter('http500').mark()
}) })

View file

@ -55,7 +55,7 @@ exports.expressCreateServer = function (hook_name, args, cb) {
ERR(err); ERR(err);
if(err == "notfound") if(err == "notfound")
res.send(404, '404 - Not Found'); res.status(404).send('404 - Not Found');
else else
res.send(html); res.send(html);
}); });

View file

@ -7,7 +7,7 @@ exports.expressCreateServer = function (hook_name, args, cb) {
//ensure the padname is valid and the url doesn't end with a / //ensure the padname is valid and the url doesn't end with a /
if(!padManager.isValidPadId(padId) || /\/$/.test(req.url)) 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 else
{ {
@ -19,7 +19,7 @@ exports.expressCreateServer = function (hook_name, args, cb) {
var query = url.parse(req.url).query; var query = url.parse(req.url).query;
if ( query ) real_url += '?' + query; if ( query ) real_url += '?' + query;
res.header('Location', real_url); 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 //the pad id was fine, so just render it
else else

View file

@ -91,7 +91,7 @@ exports.expressCreateServer = function(n, args) {
res.setHeader('Content-Type', 'application/json; charset=utf-8'); res.setHeader('Content-Type', 'application/json; charset=utf-8');
res.send('{"'+locale+'":'+JSON.stringify(locales[locale])+'}'); res.send('{"'+locale+'":'+JSON.stringify(locales[locale])+'}');
} else { } else {
res.send(404, 'Language not available'); res.status(404).send('Language not available');
} }
}) })

View file

@ -15,7 +15,7 @@ module.exports = function (req, res, callback) {
callback(); callback();
//no access //no access
} else { } else {
res.send(403, "403 - Can't touch this"); res.status(403).send("403 - Can't touch this");
} }
}); });
} }