forked from boos/BoosAPI
fix site announcement timezone
This commit is contained in:
@@ -122,8 +122,10 @@ describe('settings and auth events', () => {
|
||||
});
|
||||
|
||||
expect(response.statusCode).toBe(200);
|
||||
const body = response.json() as { currentAdminIp?: string };
|
||||
const body = response.json() as { currentAdminIp?: string; serverTimeZone?: string };
|
||||
expect(body.currentAdminIp).toBe('203.0.113.5');
|
||||
expect(typeof body.serverTimeZone).toBe('string');
|
||||
expect((body.serverTimeZone || '').length).toBeGreaterThan(0);
|
||||
});
|
||||
|
||||
it('rejects proxy token that does not start with sk-', async () => {
|
||||
|
||||
@@ -15,7 +15,7 @@ import {
|
||||
testDatabaseConnection,
|
||||
type MigrationDialect,
|
||||
} from '../../services/databaseMigrationService.js';
|
||||
import { formatUtcSqlDateTime } from '../../services/localTimeService.js';
|
||||
import { formatUtcSqlDateTime, getResolvedTimeZone } from '../../services/localTimeService.js';
|
||||
import { extractClientIp, isIpAllowed } from '../../middleware/auth.js';
|
||||
import { invalidateSiteProxyCache, normalizeSiteProxyUrl } from '../../services/siteProxy.js';
|
||||
import { performFactoryReset } from '../../services/factoryResetService.js';
|
||||
@@ -442,6 +442,7 @@ function getRuntimeSettingsResponse(currentAdminIp = '') {
|
||||
notifyCooldownSec: config.notifyCooldownSec,
|
||||
adminIpAllowlist: config.adminIpAllowlist,
|
||||
currentAdminIp,
|
||||
serverTimeZone: getResolvedTimeZone(),
|
||||
systemProxyUrl: config.systemProxyUrl,
|
||||
proxyErrorKeywords: config.proxyErrorKeywords,
|
||||
proxyEmptyContentFailEnabled: config.proxyEmptyContentFailEnabled,
|
||||
|
||||
Reference in New Issue
Block a user