mirror of
https://git.teknik.io/Teknikode/Teknik.git
synced 2023-08-02 14:16:22 +02:00
Fixed exception if no host header is provided
This commit is contained in:
parent
21f6644d7d
commit
b789821724
@ -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();
|
||||
|
||||
|
@ -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…
Reference in New Issue
Block a user