Baseflow / flutter_cached_network_image

Download, cache and show images in a flutter app
https://baseflow.com
2.44k stars 655 forks source link

Images are not loaded when 400 status is returned #470

Closed vytautas-pranskunas- closed 4 years ago

vytautas-pranskunas- commented 4 years ago

Hi,

I am on latest flutter_cached_network_image and flutter. I see this issues for a very long time maybe it is time to fix it? Just pointing to older discussion https://github.com/Baseflow/flutter_cached_network_image/issues/273

How we can release our apps with such bug? :(

CacheManager: Failed to download file from https://s3.amazonaws.com/uifaces/faces/twitter/hugocornejo/128.jpg with error: I/flutter (11066): HttpException: Invalid statusCode: 400, uri = https://s3.amazonaws.com/uifaces/faces/twitter/hugocornejo/128.jpg

You can check an url it works. It also works on my emulator but not on device. not on Android not on iOS

vytautas-pranskunas- commented 4 years ago

But I noticed that this issue was gone for some time until I have updated to latest flutter version. I will try to downgrade in upcoming days to check.

vytautas-pranskunas- commented 4 years ago

No, Flutter downgrade did not help. Same issue Guys are you planning to fix it? People are havily depended on this - i Cannot release my app

vytautas-pranskunas- commented 4 years ago

I found an issue. For me it was that i was sending Beare header to s3 and it was deying it. So i added condition that for auth headers would not be sent to external urls.

JeanRoldanDev commented 4 years ago

String tipo = ContentType.parse(res.headers['content-type']).primaryType; if (tipo == 'image') {

}