Add tests for getMonitorCertificate

This commit is contained in:
Alex Holliday committed 2024-10-11 14:59:55 +08:00
1 parent 644363e3bb
commit 3e23d97930
4 files changed
+198 -3

No files matched your search

+2 -2
View File
@@ -86,7 +86,7 @@ const getMonitorCertificate = async (req, res, next) => {
const monitorUrl = new URL(monitor.url);
const certificate = await sslChecker(monitorUrl.hostname);
if (certificate && certificate.validTo) {
return res.json({
return res.status(200).json({
success: true,
msg: successMessages.MONITOR_CERTIFICATE,
data: {
@@ -94,7 +94,7 @@ const getMonitorCertificate = async (req, res, next) => {
},
});
} else {
return res.json({
return res.status(200).json({
success: true,
msg: successMessages.MONITOR_CERTIFICATE,
data: { certificateDate: "N/A" },