|
|
|
@ -161,19 +161,19 @@ namespace MediaBrowser.Common.Implementations.HttpClientManager
|
|
|
|
|
|
|
|
|
|
options.CancellationToken.ThrowIfCancellationRequested();
|
|
|
|
|
|
|
|
|
|
var message = GetHttpRequestMessage(options);
|
|
|
|
|
|
|
|
|
|
//if (options.EnableResponseCache && cachedInfo != null)
|
|
|
|
|
//{
|
|
|
|
|
// if (!string.IsNullOrEmpty(cachedInfo.Etag))
|
|
|
|
|
// {
|
|
|
|
|
// message.Headers.Add("If-None-Match", cachedInfo.Etag);
|
|
|
|
|
// }
|
|
|
|
|
// else if (cachedInfo.LastModified.HasValue)
|
|
|
|
|
// {
|
|
|
|
|
// message.Headers.IfModifiedSince = new DateTimeOffset(cachedInfo.LastModified.Value);
|
|
|
|
|
// }
|
|
|
|
|
//}
|
|
|
|
|
using (var message = GetHttpRequestMessage(options))
|
|
|
|
|
{
|
|
|
|
|
if (options.EnableResponseCache && cachedInfo != null)
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrEmpty(cachedInfo.Etag))
|
|
|
|
|
{
|
|
|
|
|
message.Headers.Add("If-None-Match", cachedInfo.Etag);
|
|
|
|
|
}
|
|
|
|
|
else if (cachedInfo.LastModified.HasValue)
|
|
|
|
|
{
|
|
|
|
|
message.Headers.IfModifiedSince = new DateTimeOffset(cachedInfo.LastModified.Value);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (options.ResourcePool != null)
|
|
|
|
|
{
|
|
|
|
@ -248,6 +248,8 @@ namespace MediaBrowser.Common.Implementations.HttpClientManager
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Performs a GET request and returns the resulting stream
|
|
|
|
|
/// </summary>
|
|
|
|
|