When deciding whether to use SSL, ApplicationUrlHelper.GetApplicationUrlFromCurrentRequest() has an expression port == "443" which is always false. The variable port is set to to either "" or ":" + request.ServerVariables["SERVER_PORT"], so it might sometimes be ":443" but it will never be just "443". This code has been this way for at least a year, and I don't know if the situation it tried to handle makes any sense (using port 443 over plain HTTP, for some reason??) so I've just removed it.

This commit is contained in:
Sean McLemon
2019-08-21 15:31:43 +02:00
committed by Sebastiaan Janssen
parent a24e5bd10c
commit 915b24e4e4

View File

@@ -97,8 +97,7 @@ namespace Umbraco.Core.Sync
? ":" + request.ServerVariables["SERVER_PORT"]
: "";
var useSsl = globalSettings.UseHttps || port == "443";
var ssl = useSsl ? "s" : ""; // force, whatever the first request
var ssl = globalSettings.UseHttps ? "s" : ""; // force, whatever the first request
var url = "http" + ssl + "://" + request.ServerVariables["SERVER_NAME"] + port + IOHelper.ResolveUrl(SystemDirectories.Umbraco);
return url.TrimEnd('/');