Being more descriptive

This commit is contained in:
Elitsa Marinovska
2021-12-20 15:21:12 +01:00
parent bcabf05995
commit 68fdf6521e
3 changed files with 17 additions and 7 deletions

View File

@@ -2182,7 +2182,8 @@ To manage your website, simply open the Umbraco backoffice and start adding cont
<!-- The following keys get these tokens passed in:
0: Comma delimitted list of failed folder paths
-->
<key alias="umbracoApplicationUrlCheckResult">The 'umbracoApplicationUrl' option is %0% set in your umbracoSettings.config file.</key>
<key alias="umbracoApplicationUrlCheckResultTrue"><![CDATA[The 'umbracoApplicationUrl' option is set to <strong>%0%</strong> in your umbracoSettings.config file.]]></key>
<key alias="umbracoApplicationUrlCheckResultFalse">The 'umbracoApplicationUrl' option is not set in your umbracoSettings.config file.</key>
<key alias="umbracoApplicationUrlConfigureButton">Set Umbraco application URL in Config</key>
<key alias="umbracoApplicationUrlConfigureDescription">Adds a value to the 'umbracoApplicationUrl' option of umbracoSettings.config to prevent configuring insecure endpoint as the hostname of your Umbraco application.</key>
<key alias="umbracoApplicationUrlConfigureSuccess"><![CDATA[The value of 'umbracoApplicationUrl' is now set to <strong>%0%</strong> in your umbracoSettings.config file.]]></key>

View File

@@ -2219,7 +2219,8 @@ To manage your website, simply open the Umbraco backoffice and start adding cont
<!-- The following keys get these tokens passed in:
0: Comma delimitted list of failed folder paths
-->
<key alias="umbracoApplicationUrlCheckResult">The 'umbracoApplicationUrl' option is %0% set in your umbracoSettings.config file.</key>
<key alias="umbracoApplicationUrlCheckResultTrue"><![CDATA[The 'umbracoApplicationUrl' option is set to <strong>%0%</strong> in your umbracoSettings.config file.]]></key>
<key alias="umbracoApplicationUrlCheckResultFalse">The 'umbracoApplicationUrl' option is not set in your umbracoSettings.config file.</key>
<key alias="umbracoApplicationUrlConfigureButton">Set Umbraco application URL in Config</key>
<key alias="umbracoApplicationUrlConfigureDescription">Adds a value to the 'umbracoApplicationUrl' option of umbracoSettings.config to prevent configuring insecure endpoint as the hostname of your Umbraco application.</key>
<key alias="umbracoApplicationUrlConfigureSuccess"><![CDATA[The value of 'umbracoApplicationUrl' is now set to <strong>%0%</strong> in your umbracoSettings.config file.]]></key>

View File

@@ -52,20 +52,28 @@ namespace Umbraco.Web.HealthCheck.Checks.Security
private HealthCheckStatus CheckUmbracoApplicationUrl()
{
var urlConfigured = !_settings.WebRouting.UmbracoApplicationUrl.IsNullOrWhiteSpace();
var url = _settings.WebRouting.UmbracoApplicationUrl;
string resultMessage;
StatusResultType resultType;
var actions = new List<HealthCheckAction>();
string resultMessage = _textService.Localize("healthcheck", "umbracoApplicationUrlCheckResult", new[] { urlConfigured ? string.Empty : "not" });
StatusResultType resultType = urlConfigured ? StatusResultType.Success : StatusResultType.Warning;
if (urlConfigured == false)
if (url.IsNullOrWhiteSpace())
{
resultMessage = _textService.Localize("healthcheck", "umbracoApplicationUrlCheckResultFalse");
resultType = StatusResultType.Warning;
actions.Add(new HealthCheckAction(SetApplicationUrlAction, Id)
{
Name = _textService.Localize("healthcheck", "umbracoApplicationUrlConfigureButton"),
Description = _textService.Localize("healthcheck", "umbracoApplicationUrlConfigureDescription")
});
}
else
{
resultMessage = _textService.Localize("healthcheck", "umbracoApplicationUrlCheckResultTrue", new[] { url });
resultType = StatusResultType.Success;
}
return new HealthCheckStatus(resultMessage)
{