forked from umbraco/Umbraco-CMS
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix deploy Umbraco as a child IIS application not working umbraco#11891
- Loading branch information
Alexander Tkacul
committed
Dec 17, 2022
1 parent
d5e1c73
commit 58649b1
Showing
16 changed files
with
81 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 2 additions & 3 deletions
5
src/Umbraco.Web.BackOffice/Extensions/LinkGeneratorExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/Umbraco.Web.BackOffice/Install/InstallAuthorizeAttribute.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/Umbraco.Web.BackOffice/ModelsBuilder/ModelsBuilderDashboardProvider.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
using Microsoft.AspNetCore.Http; | ||
using Microsoft.AspNetCore.Routing; | ||
using Umbraco.Cms.Core.Hosting; | ||
|
||
namespace Umbraco.Cms.Web.Common.Routing; | ||
|
||
/// <summary> | ||
/// Umbraco LinkGenerator. Generates Links with path, when no path is given. | ||
/// </summary> | ||
public class LinkGenerator | ||
{ | ||
private readonly Microsoft.AspNetCore.Routing.LinkGenerator _linkGenerator; | ||
private readonly string _pathBase; | ||
|
||
/// <summary> | ||
/// Initialize Umbraco LinkGenerator | ||
/// </summary> | ||
/// <param name="linkGenerator"></param> | ||
/// <param name="hostingEnvironment"></param> | ||
public LinkGenerator(Microsoft.AspNetCore.Routing.LinkGenerator linkGenerator, IHostingEnvironment hostingEnvironment) | ||
{ | ||
_linkGenerator = linkGenerator; | ||
_pathBase = hostingEnvironment.ApplicationVirtualPath; | ||
} | ||
|
||
public string? GetPathByAddress<TAddress>( | ||
HttpContext httpContext, | ||
TAddress address, | ||
RouteValueDictionary values, | ||
RouteValueDictionary? ambientValues = null, | ||
PathString? pathBase = null, | ||
FragmentString fragment = new FragmentString(), | ||
LinkOptions? options = null) | ||
{ | ||
pathBase ??= _pathBase; | ||
return _linkGenerator.GetPathByAddress(httpContext, address, values, ambientValues, pathBase, fragment, options); | ||
} | ||
|
||
public string? GetPathByAddress<TAddress>(TAddress address, RouteValueDictionary values, | ||
PathString pathBase = new PathString(), FragmentString fragment = new FragmentString(), | ||
LinkOptions? options = null) | ||
{ | ||
pathBase = string.IsNullOrWhiteSpace(pathBase.Value) ? new PathString(_pathBase) : pathBase; | ||
return _linkGenerator.GetPathByAddress(address, values, pathBase, fragment, options); | ||
} | ||
|
||
public string? GetUriByAddress<TAddress>(HttpContext httpContext, TAddress address, RouteValueDictionary values, | ||
RouteValueDictionary? ambientValues = null, string? scheme = null, HostString? host = null, | ||
PathString? pathBase = null, FragmentString fragment = new FragmentString(), LinkOptions? options = null) | ||
{ | ||
pathBase ??= _pathBase; | ||
return _linkGenerator.GetUriByAddress(httpContext, address, values, ambientValues, scheme, host, pathBase, fragment, options); | ||
} | ||
|
||
public string? GetUriByAddress<TAddress>(TAddress address, RouteValueDictionary values, string? scheme, HostString host, | ||
PathString pathBase = new PathString(), FragmentString fragment = new FragmentString(), | ||
LinkOptions? options = null) | ||
{ | ||
pathBase = string.IsNullOrWhiteSpace(pathBase.Value) ? new PathString(_pathBase) : pathBase; | ||
return _linkGenerator.GetUriByAddress(address, values, scheme, host, pathBase, fragment, options); | ||
} | ||
|
||
public string? GetPathByAction(string action, string controllerName, object values) => _linkGenerator.GetPathByAction(action, controllerName, values, _pathBase); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters