fix(core): Block Public API related REST calls when Public API is not enabled (#9521)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2024-05-28 14:43:22 +02:00
committed by GitHub
parent e07de837b9
commit ac4e0fbb47
4 changed files with 48 additions and 15 deletions

View File

@@ -31,6 +31,7 @@ import type { CommunityPackagesService } from '@/services/communityPackages.serv
import { Logger } from '@/Logger';
import { UrlService } from './url.service';
import { InternalHooks } from '@/InternalHooks';
import { isApiEnabled } from '@/PublicApi';
@Service()
export class FrontendService {
@@ -143,7 +144,7 @@ export class FrontendService {
},
},
publicApi: {
enabled: !config.get('publicApi.disabled') && !this.license.isAPIDisabled(),
enabled: isApiEnabled(),
latestVersion: 1,
path: config.getEnv('publicApi.path'),
swaggerUi: {