AppliStation
修订版 | a4ab378a911e444c1d35e49e4de87bc1ea86755b (tree) |
---|---|
时间 | 2017-01-21 23:59:30 |
作者 | ttp <ttp@user...> |
Commiter | ttp |
na-get-lib,ファイルダウンロードで attachment;filename= のようにセミコロン後にスペースがない場合の対応
@@ -356,6 +356,10 @@ namespace NaGet.SubCommands.SubTask | ||
356 | 356 | if (System.Text.RegularExpressions.Regex.IsMatch(contentDisposition, @" *filename=", System.Text.RegularExpressions.RegexOptions.IgnoreCase)) { |
357 | 357 | contentDisposition = "attachment; " + contentDisposition; |
358 | 358 | } |
359 | + // "atachment;filename=\""のようにセミコロンの後ろにスペースがない場合、それを補充する | |
360 | + if (System.Text.RegularExpressions.Regex.IsMatch(contentDisposition, @";[^ ]", System.Text.RegularExpressions.RegexOptions.IgnoreCase)) { | |
361 | + contentDisposition = string.Join("; ", System.Text.RegularExpressions.Regex.Split(contentDisposition, @"; *")); | |
362 | + } | |
359 | 363 | |
360 | 364 | try { |
361 | 365 | ContentDisposition parser = new ContentDisposition(contentDisposition); |