diff options
author | Tom Hunkapiller <tom@furycodes.com> | 2015-04-10 14:10:55 -0500 |
---|---|---|
committer | Tom Hunkapiller <tom@furycodes.com> | 2015-04-10 14:18:30 -0500 |
commit | fd1d285a77db1c583be3e42fb1929ecd4dd41633 (patch) | |
tree | 8fb338282c941300ff6ec230447fe6faa2ab5fd7 /src/node/hooks | |
parent | 6fad2ca39a01dbde3ef9f6ea7384b27d9d14661d (diff) | |
download | etherpad-lite-fd1d285a77db1c583be3e42fb1929ecd4dd41633.zip |
fix the rest of the deprecation warnings
Diffstat (limited to 'src/node/hooks')
-rw-r--r-- | src/node/hooks/express/errorhandling.js | 4 | ||||
-rw-r--r-- | src/node/hooks/express/padreadonly.js | 2 | ||||
-rw-r--r-- | src/node/hooks/express/padurlsanitize.js | 4 | ||||
-rw-r--r-- | src/node/hooks/i18n.js | 2 |
4 files changed, 6 insertions, 6 deletions
diff --git a/src/node/hooks/express/errorhandling.js b/src/node/hooks/express/errorhandling.js index 087dd50e..7afe80ae 100644 --- a/src/node/hooks/express/errorhandling.js +++ b/src/node/hooks/express/errorhandling.js @@ -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); } -}
\ No newline at end of file +} diff --git a/src/node/hooks/express/padreadonly.js b/src/node/hooks/express/padreadonly.js index d60d3863..66be3339 100644 --- a/src/node/hooks/express/padreadonly.js +++ b/src/node/hooks/express/padreadonly.js @@ -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); }); diff --git a/src/node/hooks/express/padurlsanitize.js b/src/node/hooks/express/padurlsanitize.js index 2aadccdc..94cbe36a 100644 --- a/src/node/hooks/express/padurlsanitize.js +++ b/src/node/hooks/express/padurlsanitize.js @@ -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 diff --git a/src/node/hooks/i18n.js b/src/node/hooks/i18n.js index 67815659..1d28b544 100644 --- a/src/node/hooks/i18n.js +++ b/src/node/hooks/i18n.js @@ -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'); } }) |