From: ttp Date: Sun, 9 Jul 2017 09:21:30 +0000 (+0900) Subject: na-get-lib, a4ab378a911e444c1d35e49e4de87bc1ea86755b でのミスを修正。 X-Git-Tag: v1.4.6b1~2 X-Git-Url: http://git.osdn.net/view?p=applistation%2FAppliStation.git;a=commitdiff_plain;h=104b92d1fdae936936dd8ceb5571980613bfbd9b na-get-lib, a4ab378a911e444c1d35e49e4de87bc1ea86755b でのミスを修正。 --- diff --git a/na-get-lib/NaGet.SubCommands.SubTask/DownloadSubTask.cs b/na-get-lib/NaGet.SubCommands.SubTask/DownloadSubTask.cs index 74cd2a9..c1ff3e4 100644 --- a/na-get-lib/NaGet.SubCommands.SubTask/DownloadSubTask.cs +++ b/na-get-lib/NaGet.SubCommands.SubTask/DownloadSubTask.cs @@ -349,11 +349,10 @@ namespace NaGet.SubCommands.SubTask HttpWebResponse httpresp = response as HttpWebResponse; if (httpresp != null) { string contentDisposition = httpresp.Headers["Content-Disposition"]; - if (! string.IsNullOrEmpty(contentDisposition)) { // おかしな Content-Disposition ヘッダ向け - //(Content-Disposition: filename=\"...\" に attachment; を補って RFC1806 に準拠させる) - if (System.Text.RegularExpressions.Regex.IsMatch(contentDisposition, @" *filename=", System.Text.RegularExpressions.RegexOptions.IgnoreCase)) { + // attachment と書いていないでいきなりfilenameからはじまるとき、attachment; を補って RFC1806 に準拠させる + if (System.Text.RegularExpressions.Regex.IsMatch(contentDisposition, @"^ *filename=", System.Text.RegularExpressions.RegexOptions.IgnoreCase)) { contentDisposition = "attachment; " + contentDisposition; } // "atachment;filename=\""のようにセミコロンの後ろにスペースがない場合、それを補充する