mirror of
https://github.com/ONLYOFFICE/server.git
synced 2026-02-10 18:05:07 +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);
|
||||
switch (data.type) {
|
||||
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;
|
||||
case 'message' :
|
||||
yield* onMessage(ctx, conn, data);
|
||||
|
||||
@ -171,19 +171,24 @@ docsCoServer.install(server, () => {
|
||||
app.get('/index.html', (req, res) => {
|
||||
return co(function*() {
|
||||
let ctx = new operationContext.Context();
|
||||
ctx.initFromRequest(req);
|
||||
let licenseInfo = yield tenantManager.getTenantLicense(ctx);
|
||||
let buildVersion = commonDefines.buildVersion;
|
||||
let buildNumber = commonDefines.buildNumber;
|
||||
let buildDate, packageType, customerId = "";
|
||||
if (licenseInfo) {
|
||||
buildDate = licenseInfo.buildDate.toISOString();
|
||||
packageType = licenseInfo.packageType;
|
||||
customerId = licenseInfo.customerId;
|
||||
try {
|
||||
ctx.initFromRequest(req);
|
||||
let licenseInfo = yield tenantManager.getTenantLicense(ctx);
|
||||
let buildVersion = commonDefines.buildVersion;
|
||||
let buildNumber = commonDefines.buildNumber;
|
||||
let buildDate, packageType, customerId = "";
|
||||
if (licenseInfo) {
|
||||
buildDate = licenseInfo.buildDate.toISOString();
|
||||
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(
|
||||
|
||||
Reference in New Issue
Block a user