mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-19 07:23:05 +03:00
beginning remote subtitle downloading
This commit is contained in:
@@ -114,9 +114,7 @@ namespace MediaBrowser.Common.Implementations.HttpClientManager
|
||||
|
||||
request.AutomaticDecompression = enableHttpCompression ? DecompressionMethods.Deflate : DecompressionMethods.None;
|
||||
|
||||
request.CachePolicy = options.CachePolicy == Net.HttpRequestCachePolicy.None ?
|
||||
new RequestCachePolicy(RequestCacheLevel.BypassCache) :
|
||||
new RequestCachePolicy(RequestCacheLevel.Revalidate);
|
||||
request.CachePolicy = new RequestCachePolicy(RequestCacheLevel.BypassCache);
|
||||
|
||||
request.ConnectionGroupName = GetHostFromUrl(options.Url);
|
||||
request.KeepAlive = true;
|
||||
@@ -124,6 +122,11 @@ namespace MediaBrowser.Common.Implementations.HttpClientManager
|
||||
request.Pipelined = true;
|
||||
request.Timeout = 20000;
|
||||
|
||||
if (!string.IsNullOrEmpty(options.Host))
|
||||
{
|
||||
request.Host = options.Host;
|
||||
}
|
||||
|
||||
#if !__MonoCS__
|
||||
// This is a hack to prevent KeepAlive from getting disabled internally by the HttpWebRequest
|
||||
// May need to remove this for mono
|
||||
@@ -234,9 +237,11 @@ namespace MediaBrowser.Common.Implementations.HttpClientManager
|
||||
!string.IsNullOrEmpty(options.RequestContent) ||
|
||||
string.Equals(httpMethod, "post", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
var bytes = options.RequestContentBytes ?? Encoding.UTF8.GetBytes(options.RequestContent ?? string.Empty);
|
||||
var bytes = options.RequestContentBytes ??
|
||||
Encoding.UTF8.GetBytes(options.RequestContent ?? string.Empty);
|
||||
|
||||
httpWebRequest.ContentType = options.RequestContentType ?? "application/x-www-form-urlencoded";
|
||||
|
||||
httpWebRequest.ContentLength = bytes.Length;
|
||||
httpWebRequest.GetRequestStream().Write(bytes, 0, bytes.Length);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user