Dark Mode

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Use AndroidClientHandler / NSUrlSessionHandler by default #1285

Open
Open
Use AndroidClientHandler / NSUrlSessionHandler by default#1285

Description

Description

I was trying to load a webp url, but the website was redirecting to a secure page with this message: "Please enable cookies."

After some workaround i just found this quick fix:

ImageService.Instance.Config.HttpClient = new HttpClient();

this replaces the custom handler

var httpClient = userDefinedConfig.HttpClient ?? new HttpClient(new HttpClientHandler() { AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate });

this doesn't work either
new HttpClient( new HttpClientHandler(){UseCookies = true, CookieContainer = new CookieContainer()});

Steps to Reproduce

var url = "https://www.worten.pt/i/2e97d63644ac80f3a9313532a89b473db197b019.jpg"

ImageService.Instance.LoadUrl(url).Retry(2).WithCache(FFImageLoading.Cache.CacheType.All).IntoAsync(ImageView);

Expected Behavior

Regular load of the webp image

Actual Behavior

at FFImageLoading.Cache.DownloadCache.DownloadAsync (System.String url, System.Threading.CancellationToken token, System.Net.Http.HttpClient client, FFImageLoading.Work.TaskParameter parameters, FFImageLoading.DownloadInformation downloadInformation) [0x0027a] in C:\projects\ffimageloading\source\FFImageLoading.Common\Cache\DownloadCache.cs:119
at FFImageLoading.Cache.DownloadCache+<>c__DisplayClass15_0.b__0 () [0x00050] in C:\projects\ffimageloading\source\FFImageLoading.Common\Cache\DownloadCache.cs:58
at FFImageLoading.Retry.DoAsync[T] (System.Func1[TResult] action, System.TimeSpan retryInterval, System.Int32 retryCount, System.Action onRetry) [0x00189] in C:\projects\ffimageloading\source\FFImageLoading.Common\Help ers\Retry.cs:51 at FFImageLoading.Cache.DownloadCache.DownloadAndCacheIfNeededA sync (System.String url, FFImageLoading.Work.TaskParameter parameters, FFImageLoading.Config.Configuration configuration, System.Threading.CancellationToken token) [0x00401] in C:\projects\ffimageloading\source\FFImageLoading.Common\Cach e\DownloadCache.cs:57 at FFImageLoading.DataResolvers.UrlDataResolver.Resolve (System.String identifier, FFImageLoading.Work.TaskParameter parameters, System.Threading.CancellationToken token) [0x00045] in C:\projects\ffimageloading\source\FFImageLoading.Common\Data Resolvers\UrlDataResolver.cs:22 at FFImageLoading.DataResolvers.WrappedDataResolver.Resolve (System.String identifier, FFImageLoading.Work.TaskParameter parameters, System.Threading.CancellationToken token) [0x0004e] in C:\projects\ffimageloading\source\FFImageLoading.Common\Data Resolvers\WrappedDataResolver.cs:21 at FFImageLoading.Work.ImageLoaderTask3[TDecoderContainer,TImageContainer,TImageView].RunAsync () [0x00300] in C:\projects\ffimageloading\source\FFImageLoading.Common\Work\ImageLoaderTask.cs:618

Basic Information

  • Version with issue: 2.4.11.982
  • Last known good version: NA
  • Platform: Android

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions