Merge pull request #3121 from web-engineer/fix/3120-data-leak

3120 remove URL's from data when they are supposed to be disabled
This commit is contained in:
Alexander Holliday authored and GitHub committed 2026-01-15 14:24:47 -08:00
commit d82877b28d
8 files changed
+33 -28

No files matched your search

+11 -6
View File
@@ -1,4 +1,3 @@
// import StatusPage from "../../models/StatusPage.js";
// import { NormalizeData } from "../../../utils/dataUtils.js";
// import ServiceRegistry from "../../../service/system/serviceRegistry.js";
// import StringService from "../../../service/system/stringService.js";
@@ -6,10 +5,11 @@
const SERVICE_NAME = "statusPageModule";
class StatusPageModule {
constructor({ StatusPage, NormalizeData, stringService }) {
constructor({ StatusPage, NormalizeData, stringService, AppSettings }) {
this.StatusPage = StatusPage;
this.NormalizeData = NormalizeData;
this.stringService = stringService;
this.AppSettings = AppSettings;
}
createStatusPage = async ({ statusPageData, image, userId, teamId }) => {
@@ -260,11 +260,16 @@ class StatusPageModule {
const { statusPage, monitors } = statusPageQuery[0];
const appSettings = await this.AppSettings.findOne({ singleton: true }).lean();
const showURL = appSettings?.showURL === true;
const normalizedMonitors = monitors.map((monitor) => {
return {
...monitor,
checks: this.NormalizeData(monitor.checks, 10, 100),
};
const normalizedChecks = this.NormalizeData(monitor.checks, 10, 100);
if (!showURL) {
const { url, port, secret, notifications, ...rest } = monitor;
return { ...rest, checks: normalizedChecks };
}
return { ...monitor, checks: normalizedChecks };
});
return { statusPage, monitors: normalizedMonitors };