aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs
diff options
context:
space:
mode:
authorMark Monteiro <marknr.monteiro@protonmail.com>2020-05-14 11:08:08 -0400
committerGitHub <noreply@github.com>2020-05-14 11:08:08 -0400
commit2e09311a93cbf7b4d0629e058974a84e70c4b800 (patch)
tree9217bb9d15df7f1a516afcbc2f531bbc35161a53 /Emby.Server.Implementations/HttpServer/HttpListenerHost.cs
parent3623aafcb60dec4f4f5055046717d895b7597b60 (diff)
parent11dd96f6c715b0f701903e636f08ee910c9a08eb (diff)
Merge branch 'master' into websocket
Diffstat (limited to 'Emby.Server.Implementations/HttpServer/HttpListenerHost.cs')
-rw-r--r--Emby.Server.Implementations/HttpServer/HttpListenerHost.cs7
1 files changed, 5 insertions, 2 deletions
diff --git a/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs b/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs
index 7358c1a81..81e793f5c 100644
--- a/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs
+++ b/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs
@@ -366,11 +366,14 @@ namespace Emby.Server.Implementations.HttpServer
return true;
}
+ /// <summary>
+ /// Validate a connection from a remote IP address to a URL to see if a redirection to HTTPS is required.
+ /// </summary>
+ /// <returns>True if the request is valid, or false if the request is not valid and an HTTPS redirect is required.</returns>
private bool ValidateSsl(string remoteIp, string urlString)
{
if (_config.Configuration.RequireHttps
- && _appHost.EnableHttps
- && !_config.Configuration.IsBehindProxy
+ && _appHost.ListenWithHttps
&& !urlString.Contains("https://", StringComparison.OrdinalIgnoreCase))
{
// These are hacks, but if these ever occur on ipv6 in the local network they could be incorrectly redirected