mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-05-09 08:25:00 -04:00
send utf-8 charset @ api
This commit is contained in:
parent
80c9f8ae8f
commit
b96bff996d
1 changed files with 14 additions and 4 deletions
|
@ -21,6 +21,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var log4js = require('log4js');
|
var log4js = require('log4js');
|
||||||
|
var os = require("os");
|
||||||
var socketio = require('socket.io');
|
var socketio = require('socket.io');
|
||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
var settings = require('./utils/Settings');
|
var settings = require('./utils/Settings');
|
||||||
|
@ -280,7 +281,7 @@ async.waterfall([
|
||||||
app.get('/api/1/:func', function(req, res)
|
app.get('/api/1/:func', function(req, res)
|
||||||
{
|
{
|
||||||
res.header("Server", serverName);
|
res.header("Server", serverName);
|
||||||
res.header("Content-Type", "application/json");
|
res.header("Content-Type", "application/json; charset=utf-8");
|
||||||
|
|
||||||
apiLogger.info("REQUEST, " + req.params.func + ", " + JSON.stringify(req.query));
|
apiLogger.info("REQUEST, " + req.params.func + ", " + JSON.stringify(req.query));
|
||||||
|
|
||||||
|
@ -378,10 +379,20 @@ async.waterfall([
|
||||||
|
|
||||||
process.exit(0);
|
process.exit(0);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
setTimeout(function(){
|
||||||
|
process.exit(1);
|
||||||
|
}, 3000);
|
||||||
}
|
}
|
||||||
|
|
||||||
//connect graceful shutdown with sigint and uncaughtexception
|
//connect graceful shutdown with sigint and uncaughtexception
|
||||||
process.on('SIGINT', gracefulShutdown);
|
if(os.type().indexOf("Windows") == -1)
|
||||||
|
{
|
||||||
|
//sigint is so far not working on windows
|
||||||
|
//https://github.com/joyent/node/issues/1553
|
||||||
|
process.on('SIGINT', gracefulShutdown);
|
||||||
|
}
|
||||||
|
|
||||||
process.on('uncaughtException', gracefulShutdown);
|
process.on('uncaughtException', gracefulShutdown);
|
||||||
|
|
||||||
//init socket.io and redirect all requests to the MessageHandler
|
//init socket.io and redirect all requests to the MessageHandler
|
||||||
|
@ -395,8 +406,7 @@ async.waterfall([
|
||||||
io.set('logger', {
|
io.set('logger', {
|
||||||
debug: function (str)
|
debug: function (str)
|
||||||
{
|
{
|
||||||
//supress debug messages
|
socketIOLogger.debug(str);
|
||||||
//socketIOLogger.debug(str);
|
|
||||||
},
|
},
|
||||||
info: function (str)
|
info: function (str)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue