mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 11:44:58 +08:00
Change port of urls in multi tenant admin
--HG-- branch : dev
This commit is contained in:
@@ -4,11 +4,17 @@ using Orchard.Environment.Configuration;
|
||||
namespace Orchard.MultiTenancy.Extensions {
|
||||
public static class UrlHelperExtensions {
|
||||
public static string Tenant(this UrlHelper urlHelper, ShellSettings tenantShellSettings) {
|
||||
return string.Format(
|
||||
"http://{0}/{1}",
|
||||
!string.IsNullOrEmpty(tenantShellSettings.RequestUrlHost)
|
||||
? tenantShellSettings.RequestUrlHost
|
||||
: urlHelper.RequestContext.HttpContext.Request.Headers["Host"],
|
||||
//info: (heskew) might not keep the port insertion around beyond...
|
||||
var port = string.Empty;
|
||||
string host = urlHelper.RequestContext.HttpContext.Request.Headers["Host"];
|
||||
|
||||
if(host.Contains(":"))
|
||||
port = host.Substring(host.IndexOf(":"));
|
||||
|
||||
return string.Format(
|
||||
"http://{0}/{1}",
|
||||
!string.IsNullOrEmpty(tenantShellSettings.RequestUrlHost)
|
||||
? tenantShellSettings.RequestUrlHost + port : host,
|
||||
tenantShellSettings.RequestUrlPrefix);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user