Merge pull request #638 from bluewave-labs/fix/getMonitorById

Updated parameters passed to  for certificate check
This commit is contained in:
Alexander Holliday authored and GitHub committed 2024-08-15 11:45:02 -07:00
commit cef2ff5d67
3 files changed
+2 -3

No files matched your search

+2 -1
View File
@@ -77,7 +77,8 @@ const getMonitorCertificate = async (req, res, next) => {
}
try {
const monitor = await req.db.getMonitorById(req, res);
const { monitorId } = req.params;
const monitor = await req.db.getMonitorById(monitorId);
const monitorUrl = new URL(monitor.url);
const certificate = await sslChecker(monitorUrl.hostname);
if (certificate && certificate.validTo) {
-1
View File
@@ -2,7 +2,6 @@ const logger = require("../utils/logger");
const { errorMessages } = require("../utils/messages");
const handleErrors = (error, req, res, next) => {
console.log(error);
const status = error.status || 500;
const message = error.message || errorMessages.FRIENDLY_ERROR;
const service = error.service || errorMessages.UNKNOWN_SERVICE;
-1
View File
@@ -31,7 +31,6 @@ const verifyOwnership = (Model, paramName) => {
// If the userID does not match the document's userID, return a 403 error
if (userId.toString() !== doc.userId.toString()) {
console.log(userId.toString(), doc.userId.toString());
const error = new Error(errorMessages.VERIFY_OWNER_UNAUTHORIZED);
error.status = 403;
throw error;