mirror of
https://github.com/ONLYOFFICE/server.git
synced 2026-04-07 14:04:35 +08:00
[bug] Fix crash with unknown tenant
This commit is contained in:
committed by
catbasilio
parent
c0f1327bf6
commit
c1985c6c97
@ -1354,7 +1354,13 @@ exports.install = function(server, callbackFunction) {
|
|||||||
yield encryptPasswordParams(ctx, data);
|
yield encryptPasswordParams(ctx, data);
|
||||||
switch (data.type) {
|
switch (data.type) {
|
||||||
case 'auth' :
|
case 'auth' :
|
||||||
yield* auth(ctx, conn, data);
|
try {
|
||||||
|
yield* auth(ctx, conn, data);
|
||||||
|
} catch(err){
|
||||||
|
ctx.logger.error('auth error: %s', err.stack);
|
||||||
|
conn.close(constants.ACCESS_DENIED_CODE, constants.ACCESS_DENIED_REASON);
|
||||||
|
return;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 'message' :
|
case 'message' :
|
||||||
yield* onMessage(ctx, conn, data);
|
yield* onMessage(ctx, conn, data);
|
||||||
|
|||||||
@ -171,19 +171,24 @@ docsCoServer.install(server, () => {
|
|||||||
app.get('/index.html', (req, res) => {
|
app.get('/index.html', (req, res) => {
|
||||||
return co(function*() {
|
return co(function*() {
|
||||||
let ctx = new operationContext.Context();
|
let ctx = new operationContext.Context();
|
||||||
ctx.initFromRequest(req);
|
try {
|
||||||
let licenseInfo = yield tenantManager.getTenantLicense(ctx);
|
ctx.initFromRequest(req);
|
||||||
let buildVersion = commonDefines.buildVersion;
|
let licenseInfo = yield tenantManager.getTenantLicense(ctx);
|
||||||
let buildNumber = commonDefines.buildNumber;
|
let buildVersion = commonDefines.buildVersion;
|
||||||
let buildDate, packageType, customerId = "";
|
let buildNumber = commonDefines.buildNumber;
|
||||||
if (licenseInfo) {
|
let buildDate, packageType, customerId = "";
|
||||||
buildDate = licenseInfo.buildDate.toISOString();
|
if (licenseInfo) {
|
||||||
packageType = licenseInfo.packageType;
|
buildDate = licenseInfo.buildDate.toISOString();
|
||||||
customerId = licenseInfo.customerId;
|
packageType = licenseInfo.packageType;
|
||||||
|
customerId = licenseInfo.customerId;
|
||||||
|
}
|
||||||
|
let output = `Server is functioning normally. Version: ${buildVersion}. Build: ${buildNumber}`;
|
||||||
|
output += `. Release date: ${buildDate}. Package type: ${packageType}. Customer Id: ${customerId}`;
|
||||||
|
res.send(output);
|
||||||
|
} catch (err) {
|
||||||
|
ctx.logger.error('index.html error: %s', err.stack);
|
||||||
|
res.sendStatus(400);
|
||||||
}
|
}
|
||||||
let output = `Server is functioning normally. Version: ${buildVersion}. Build: ${buildNumber}`;
|
|
||||||
output += `. Release date: ${buildDate}. Package type: ${packageType}. Customer Id: ${customerId}`;
|
|
||||||
res.send(output);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
const rawFileParser = bodyParser.raw(
|
const rawFileParser = bodyParser.raw(
|
||||||
|
|||||||
Reference in New Issue
Block a user