diff --git a/src/Android/Android.csproj b/src/Android/Android.csproj index b5f3a740d..516b32b69 100644 --- a/src/Android/Android.csproj +++ b/src/Android/Android.csproj @@ -74,6 +74,7 @@ + diff --git a/src/Android/MainApplication.cs b/src/Android/MainApplication.cs index 0460641e5..5fe22c688 100644 --- a/src/Android/MainApplication.cs +++ b/src/Android/MainApplication.cs @@ -16,6 +16,7 @@ using Bit.Droid.Utilities; using Plugin.CurrentActivity; using Plugin.Fingerprint; using Xamarin.Android.Net; +using System.Net.Http; #if !FDROID using Android.Gms.Security; #endif @@ -78,7 +79,8 @@ namespace Bit.Droid FFImageLoading.ImageService.Instance.Initialize(new FFImageLoading.Config.Configuration { FadeAnimationEnabled = false, - FadeAnimationForCachedImages = false + FadeAnimationForCachedImages = false, + HttpClient = new HttpClient(new AndroidHttpImageClientHandler()) }); ZXing.Net.Mobile.Forms.Android.Platform.Init(); }); @@ -144,5 +146,15 @@ namespace Bit.Droid Constants.DisableFaviconKey, disableFavicon); await ServiceContainer.Resolve("environmentService").SetUrlsFromStorageAsync(); } + + public class AndroidHttpImageClientHandler : HttpClientHandler + { + protected override async Task SendAsync(HttpRequestMessage request, + System.Threading.CancellationToken cancellationToken) + { + request.Version = new Version(1, 0); + return await base.SendAsync(request, cancellationToken); + } + } } }