From b9811de7a080dbce7eed4a92e68de73ba831c8d0 Mon Sep 17 00:00:00 2001 From: ttp Date: Wed, 23 Dec 2009 14:06:32 +0900 Subject: [PATCH] =?utf8?q?na-get-lib,=E3=83=80=E3=82=A6=E3=83=B3=E3=83=AD?= =?utf8?q?=E3=83=BC=E3=83=89=E5=87=A6=E7=90=86=E3=81=AB=E3=81=8A=E3=81=84?= =?utf8?q?=E3=81=A6=E3=80=81HTTP=E5=9C=A7=E7=B8=AE=E3=81=AB=E5=AF=BE?= =?utf8?q?=E5=BF=9C=E3=81=97=E3=81=9F=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- na-get-lib/NaGet.Net/Downloader.cs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/na-get-lib/NaGet.Net/Downloader.cs b/na-get-lib/NaGet.Net/Downloader.cs index bd74468..623e787 100644 --- a/na-get-lib/NaGet.Net/Downloader.cs +++ b/na-get-lib/NaGet.Net/Downloader.cs @@ -165,6 +165,11 @@ public class Downloader : NaGetTask request.Proxy = this.Proxy; request.CachePolicy = new System.Net.Cache.RequestCachePolicy(CacheLevel); + HttpWebRequest httpRequest = request as HttpWebRequest; + if (httpRequest != null) { + httpRequest.AutomaticDecompression = DecompressionMethods.Deflate | DecompressionMethods.GZip; + } + if (cancelCalled) { throw new NaGetTaskCanceledException(string.Empty); } @@ -249,10 +254,13 @@ public class Downloader : NaGetTask // 更新日を補完 if (File.Exists(filepath)) { - if (response is HttpWebResponse) { - File.SetLastWriteTime(filepath, ((HttpWebResponse) response).LastModified); - } else if (response is FtpWebResponse) { - File.SetLastWriteTime(filepath, ((FtpWebResponse) response).LastModified); + HttpWebResponse httpResponse = response as HttpWebResponse; + FtpWebResponse ftpResponse = response as FtpWebResponse; + + if (httpResponse != null) { + File.SetLastWriteTime(filepath, httpResponse.LastModified); + } else if (ftpResponse != null) { + File.SetLastWriteTime(filepath, ftpResponse.LastModified); } } } finally { -- 2.11.0