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 @@
-
+