diff --git a/Pleroma/Pleroma.cs b/Pleroma/Pleroma.cs index 8b3fe89..6761f89 100644 --- a/Pleroma/Pleroma.cs +++ b/Pleroma/Pleroma.cs @@ -669,7 +669,11 @@ public class Pleroma /// public async Task DownloadStream(Attachment attachment) { - HttpResponseMessage res = await HttpClient.GetAsync(attachment.URL); + using HttpClient client = new HttpClient(); + if (HttpClient.BaseAddress != null && new Uri(attachment.URL).Host == HttpClient.BaseAddress.Host) + client.DefaultRequestHeaders.Authorization = HttpClient.DefaultRequestHeaders.Authorization; + + HttpResponseMessage res = await client.GetAsync(attachment.URL); res.EnsureSuccessStatusCode(); return await res.Content.ReadAsStreamAsync(); }