|
|
@ -423,6 +423,19 @@ namespace Emby.Server.Implementations.HttpServer
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private bool ValidateSsl(string remoteIp)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (_config.Configuration.RequireHttps && _appHost.EnableHttps)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (!_networkManager.IsInLocalNetwork(remoteIp))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// Overridable method that can be used to implement a custom hnandler
|
|
|
|
/// Overridable method that can be used to implement a custom hnandler
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
@ -453,6 +466,12 @@ namespace Emby.Server.Implementations.HttpServer
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!ValidateSsl(httpReq.RemoteIp))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
RedirectToUrl(httpRes, urlString.Replace("http://", "https://", StringComparison.OrdinalIgnoreCase));
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (string.Equals(httpReq.Verb, "OPTIONS", StringComparison.OrdinalIgnoreCase))
|
|
|
|
if (string.Equals(httpReq.Verb, "OPTIONS", StringComparison.OrdinalIgnoreCase))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
httpRes.StatusCode = 200;
|
|
|
|
httpRes.StatusCode = 200;
|
|
|
|