U4-1441 - change trySkipIisCustomError config key

This commit is contained in:
Stephan
2013-02-08 07:36:35 -01:00
parent b8bcb3820a
commit a03f5420fa
4 changed files with 50 additions and 18 deletions

View File

@@ -157,11 +157,32 @@ namespace Umbraco.Core.Configuration
{
EnsureSettingsDocument();
string attrName = null;
var pos = key.IndexOf('@');
if (pos > 0)
{
attrName = key.Substring(pos + 1);
key = key.Substring(0, pos - 1);
}
var node = UmbracoSettingsXmlDoc.DocumentElement.SelectSingleNode(key);
if (node == null || node.FirstChild == null || node.FirstChild.Value == null)
return string.Empty;
return node.FirstChild.Value;
}
if (node == null)
return string.Empty;
if (pos < 0)
{
if (node.FirstChild == null || node.FirstChild.Value == null)
return string.Empty;
return node.FirstChild.Value;
}
else
{
var attr = node.Attributes[attrName];
if (attr == null)
return string.Empty;
return attr.Value;
}
}
/// <summary>
/// Gets a value indicating whether the media library will create new directories in the /media directory.
@@ -647,7 +668,7 @@ namespace Umbraco.Core.Configuration
get
{
// default: false
return GetKeyWithOverride("/settings/TrySkipIisCustomErrors", false, _trySkipIisCustomErrors);
return GetKeyWithOverride("/settings/web.routing/@trySkipIisCustomErrors", false, _trySkipIisCustomErrors);
}
internal set
{

View File

@@ -453,6 +453,7 @@
</None>
<None Include="Config\umbracoSettings.Release.config">
<DependentUpon>umbracoSettings.config</DependentUpon>
<SubType>Designer</SubType>
</None>
<None Include="Config\trees.Release.config">
<DependentUpon>trees.config</DependentUpon>
@@ -2358,7 +2359,9 @@
<SubType>Designer</SubType>
</Content>
<Content Include="Config\tinyMceConfig.config" />
<Content Include="Config\umbracoSettings.config" />
<Content Include="Config\umbracoSettings.config">
<SubType>Designer</SubType>
</Content>
<Content Include="Config\xsltExtensions.config" />
<Content Include="Config\UrlRewriting.config" />
<Content Include="Config\log4net.config" />

View File

@@ -242,12 +242,16 @@
</help>
<!--
Try to skip IIS custom errors.
Starting with IIS 7.5, this must be set to true for Umbraco 404 pages to show. Else, IIS will take
over and render its build-in error page. See MS doc for HttpResponseBase.TrySkipIisCustomErrors.
The default value is false, for backward compatibility reasons, which means that IIS _will_ take
over, and _prevent_ Umbraco 404 pages to show.
web.routing
@trySkipIisCustomErrors
Tries to skip IIS custom errors.
Starting with IIS 7.5, this must be set to true for Umbraco 404 pages to show. Else, IIS will take
over and render its build-in error page. See MS doc for HttpResponseBase.TrySkipIisCustomErrors.
The default value is false, for backward compatibility reasons, which means that IIS _will_ take
over, and _prevent_ Umbraco 404 pages to show.
-->
<TrySkipIisCustomErrors>false</TrySkipIisCustomErrors>
<web.routing
trySkipIisCustomErrors="false">
</web.routing>
</settings>

View File

@@ -193,12 +193,16 @@
</help>
<!--
Try to skip IIS custom errors.
Starting with IIS 7.5, this must be set to true for Umbraco 404 pages to show. Else, IIS will take
over and render its build-in error page. See MS doc for HttpResponseBase.TrySkipIisCustomErrors.
The default value is false, for backward compatibility reasons, which means that IIS _will_ take
over, and _prevent_ Umbraco 404 pages to show.
web.routing
@trySkipIisCustomErrors
Tries to skip IIS custom errors.
Starting with IIS 7.5, this must be set to true for Umbraco 404 pages to show. Else, IIS will take
over and render its build-in error page. See MS doc for HttpResponseBase.TrySkipIisCustomErrors.
The default value is false, for backward compatibility reasons, which means that IIS _will_ take
over, and _prevent_ Umbraco 404 pages to show.
-->
<TrySkipIisCustomErrors>false</TrySkipIisCustomErrors>
<web.routing
trySkipIisCustomErrors="false">
</web.routing>
</settings>