Browse Source

Fixed exception if no host header is provided

tags/2.0.6
Teknikode 3 years ago
parent
commit
b789821724

+ 1
- 0
Teknik/App_Start/SubdomainRoute.cs View File

@@ -47,6 +47,7 @@ namespace Teknik
if (routeData == null) return null; // Only look at the subdomain if this route matches in the first place.
string subdomain = httpContext.Request.QueryString["sub"]; // A subdomain specified as a query parameter takes precedence over the hostname.
string host = httpContext.Request.Headers["Host"];
if (host == null) return null; // no host, so don't process it
string domain = host.GetDomain();
string curSub = host.GetSubdomain();


+ 0
- 11
Teknik/Areas/User/Views/User/_LoginPartial.cshtml View File

@@ -40,24 +40,13 @@
<noscript>
<a href="@Url.SubRouteUrl("user", "User.Register")" class="btn btn-default navbar-btn">Sign Up</a>
</noscript>
@*<a class="dropdown-toggle" href="#" data-toggle="dropdown" id="reg_dropdown">Sign Up <strong class="caret"></strong></a>
<div class="dropdown-menu" style="padding: 15px; padding-bottom: 0px; min-width: 100px;">
@Html.Partial("../../Areas/User/Views/User/Register", new Teknik.Areas.Users.ViewModels.RegisterViewModel())
</div>*@
}
if (Model.Config.UserConfig.LoginEnabled)
{
if (Model.Config.UserConfig.RegistrationEnabled)
{
}
<button id="loginButton" data-toggle="modal" data-target="#loginModal" class="btn btn-default navbar-btn hide">Sign In</button>
<noscript>
<a href="@Url.SubRouteUrl("user", "User.Login")" class="btn btn-default navbar-btn">Sign In</a>
</noscript>
@*<a class="dropdown-toggle" href="#" data-toggle="dropdown" id="login_dropdown">Sign In <strong class="caret"></strong></a>
<div class="dropdown-menu" style="padding: 15px; padding-bottom: 0px;">
@Html.Partial("../../Areas/User/Views/User/Login", new Teknik.Areas.Users.ViewModels.LoginViewModel())
</div>*@
}
}
</div>

Loading…
Cancel
Save