Open WillComesBack opened 1 year ago
I'm checking the console and I see it's not being passed
but in Image.network, it is being passed just fine
Going to close. I realized the tag says it does not support Web as I was testing on Web. Sorry about that
Hi,
I encounter the same issue running my project on Web platform.
Issue comes from the default image renderer for web : ImageRenderMethodForWeb.HtmlImage
which ignores headers
.
Using ImageRenderMethodForWeb.HttpGet
fixes the issue :
import 'package:cached_network_image/cached_network_image.dart';
import 'package:cached_network_image_platform_interface/cached_network_image_platform_interface.dart';
class MyWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return CachedNetworkImage(
imageRenderMethodForWeb: ImageRenderMethodForWeb.HttpGet,
fit: BoxFit.cover,
imageUrl:
'http://pngimg.com/uploads/simpsons/simpsons_PNG94.png',
httpHeaders: const {
'test_header': 'test value',
},
);
}
}
Same issue, tested on android
I have a piece of code that passes in a bearer token
I get the token and I make this call, but I get a 401 error
I do the same for Image.network and it works just fine. Am I doing something wrong?