diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2017-08-17 16:19:02 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2017-08-17 16:19:02 -0400 |
| commit | a7dcf7191a71bfefd4a8c69d24d2eec53973bb83 (patch) | |
| tree | 6419c67eef23c5c86fe474448c5e9c78a2172b30 /Emby.Server.Implementations/HttpClientManager/HttpClientManager.cs | |
| parent | a57c887f7f367402cd1e3e215a8b8052f3c603da (diff) | |
add fixes for .net core
Diffstat (limited to 'Emby.Server.Implementations/HttpClientManager/HttpClientManager.cs')
| -rw-r--r-- | Emby.Server.Implementations/HttpClientManager/HttpClientManager.cs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Emby.Server.Implementations/HttpClientManager/HttpClientManager.cs b/Emby.Server.Implementations/HttpClientManager/HttpClientManager.cs index 1017953ba..f512b723d 100644 --- a/Emby.Server.Implementations/HttpClientManager/HttpClientManager.cs +++ b/Emby.Server.Implementations/HttpClientManager/HttpClientManager.cs @@ -66,8 +66,10 @@ namespace Emby.Server.Implementations.HttpClientManager // http://stackoverflow.com/questions/566437/http-post-returns-the-error-417-expectation-failed-c ServicePointManager.Expect100Continue = false; - // Trakt requests sometimes fail without this +#if NET46 +// Trakt requests sometimes fail without this ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls; +#endif } /// <summary> @@ -428,7 +430,7 @@ namespace Emby.Server.Implementations.HttpClientManager try { var bytes = options.RequestContentBytes ?? - Encoding.UTF8.GetBytes(options.RequestContent ?? string.Empty); + Encoding.UTF8.GetBytes(options.RequestContent ?? string.Empty); httpWebRequest.ContentType = options.RequestContentType ?? "application/x-www-form-urlencoded"; @@ -727,7 +729,7 @@ namespace Emby.Server.Implementations.HttpClientManager } var webException = ex as WebException - ?? ex.InnerException as WebException; + ?? ex.InnerException as WebException; if (webException != null) { @@ -762,7 +764,7 @@ namespace Emby.Server.Implementations.HttpClientManager } var operationCanceledException = ex as OperationCanceledException - ?? ex.InnerException as OperationCanceledException; + ?? ex.InnerException as OperationCanceledException; if (operationCanceledException != null) { |
