From ff51704cdfcc7853076a62e67b8fc33cfd04c17a Mon Sep 17 00:00:00 2001 From: Louis Lam Date: Sun, 17 Sep 2023 02:40:08 +0800 Subject: [PATCH] Fix #3712 --- server/model/monitor.js | 15 ++++++++++++++- src/components/PublicGroupList.vue | 2 +- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/server/model/monitor.js b/server/model/monitor.js index 1cea35533..6a456acf9 100644 --- a/server/model/monitor.js +++ b/server/model/monitor.js @@ -53,7 +53,7 @@ class Monitor extends BeanModel { obj.tags = await this.getTags(); } - if (certExpiry && this.type === "http") { + if (certExpiry && this.type === "http" && this.getURLProtocol() === "https:") { const { certExpiryDaysRemaining, validCert } = await this.getCertExpiry(this.id); obj.certExpiryDaysRemaining = certExpiryDaysRemaining; obj.validCert = validCert; @@ -1075,6 +1075,19 @@ class Monitor extends BeanModel { } } + /** + * Example: http: or https: + * @returns {(null|string)} + */ + getURLProtocol() { + const url = this.getUrl(); + if (url) { + return this.getUrl().protocol; + } else { + return null; + } + } + /** * Store TLS info to database * @param checkCertificateResult diff --git a/src/components/PublicGroupList.vue b/src/components/PublicGroupList.vue index ba2230f0e..5fd09fca3 100644 --- a/src/components/PublicGroupList.vue +++ b/src/components/PublicGroupList.vue @@ -62,7 +62,7 @@
-
+