From 6c4f21b8e55ead352bc51a5131cfd73e009c0e9e Mon Sep 17 00:00:00 2001 From: shahram Date: Mon, 13 Nov 2023 01:53:59 -0800 Subject: [PATCH] fix: resolves #158 - handle http URLs gracefully --- components/status-page.js | 2 +- nerdlets/status-page-dashboard/main-page.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/components/status-page.js b/components/status-page.js index cec28b3..5000026 100644 --- a/components/status-page.js +++ b/components/status-page.js @@ -404,7 +404,7 @@ export default class StatusPage extends React.PureComponent { const urlObject = new URL(url.inputValue); if (urlObject.protocol !== 'https:') { url.validationText = - 'Please use Secure Socket Layer (HTTPS) protocol for this URL'; + 'Please try using Secure Socket Layer (HTTPS) protocol for this URL, and see if it works. Use of HTTP protocol is not allowed'; } }; diff --git a/nerdlets/status-page-dashboard/main-page.js b/nerdlets/status-page-dashboard/main-page.js index aefdcc6..40a6489 100644 --- a/nerdlets/status-page-dashboard/main-page.js +++ b/nerdlets/status-page-dashboard/main-page.js @@ -144,7 +144,7 @@ export default class StatusPagesDashboard extends React.PureComponent { ? '. Please also ' : 'Please '; urlField.validationText += - 'use Secure Socket Layer (HTTPS) protocol for this URL'; + 'try using Secure Socket Layer (HTTPS) protocol for this URL, and see if it works. Use of HTTP protocol is not allowed'; } }; @@ -218,7 +218,7 @@ export default class StatusPagesDashboard extends React.PureComponent { } } - [corsProxyAddress, hostName, logoUrl].forEach((urlField, index) => { + [corsProxyAddress, hostName, logoUrl].forEach((urlField) => { if (urlField?.inputValue) { validateUrl(urlField); if (urlField.validationText) isFormValid = false;