diff --git a/server/Ksp.WebServer/Startup.cs b/server/Ksp.WebServer/Startup.cs index 71cdffc..e1e8615 100644 --- a/server/Ksp.WebServer/Startup.cs +++ b/server/Ksp.WebServer/Startup.cs @@ -106,7 +106,7 @@ namespace Ksp.WebServer { response.Headers.Location = new UriBuilder(response.Headers.Location) { Host = cx.Request.Host.Host, - Port = cx.Request.Host.Port.Value, + Port = cx.Request.Host.Port ?? (cx.Request.Scheme == "https" ? 443 : 80), Scheme = cx.Request.Scheme }.Uri; }