put request message disposal back in

This commit is contained in:
Luke Pulverenti 2013-05-22 12:51:39 -04:00
parent 831dfaee87
commit 410b46f05d

View File

@ -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>