Skip to content

Commit 6d3be25

Browse files
committed
fix 302
1 parent 119aac4 commit 6d3be25

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/Midjourney.Base/Util/FileFetchHelper.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,11 @@ public async Task<FetchFileResult> FetchFileAsync(string url)
131131
// 如果是重定向,则尝试获取新的 URL
132132
if (response.Headers.Location != null)
133133
{
134-
url = response.Headers.Location.ToString();
135-
136-
return await FetchFileAsync(url);
134+
var newUrl = response.Headers.Location.ToString();
135+
if (newUrl != url)
136+
{
137+
return await FetchFileAsync(url);
138+
}
137139
}
138140
}
139141

0 commit comments

Comments
 (0)