AppliStation
修订版 | 104b92d1fdae936936dd8ceb5571980613bfbd9b (tree) |
---|---|
时间 | 2017-07-09 18:23:15 |
作者 | ttp <ttp@user...> |
Commiter | ttp |
na-get-lib, a4ab378a911e444c1d35e49e4de87bc1ea86755b でのミスを修正。
@@ -349,11 +349,10 @@ namespace NaGet.SubCommands.SubTask | ||
349 | 349 | HttpWebResponse httpresp = response as HttpWebResponse; |
350 | 350 | if (httpresp != null) { |
351 | 351 | string contentDisposition = httpresp.Headers["Content-Disposition"]; |
352 | - | |
353 | 352 | if (! string.IsNullOrEmpty(contentDisposition)) { |
354 | 353 | // おかしな Content-Disposition ヘッダ向け |
355 | - //(Content-Disposition: filename=\"...\" に attachment; を補って RFC1806 に準拠させる) | |
356 | - if (System.Text.RegularExpressions.Regex.IsMatch(contentDisposition, @" *filename=", System.Text.RegularExpressions.RegexOptions.IgnoreCase)) { | |
354 | + // attachment と書いていないでいきなりfilenameからはじまるとき、attachment; を補って RFC1806 に準拠させる | |
355 | + if (System.Text.RegularExpressions.Regex.IsMatch(contentDisposition, @"^ *filename=", System.Text.RegularExpressions.RegexOptions.IgnoreCase)) { | |
357 | 356 | contentDisposition = "attachment; " + contentDisposition; |
358 | 357 | } |
359 | 358 | // "atachment;filename=\""のようにセミコロンの後ろにスペースがない場合、それを補充する |