The headers are incorrect for both CachedNetworkImageProvider and CachedNetworkImage I think and I am curious if there is a workaround, or if that is intentional or a bug.
CachedNetworkImage(
imageUrl: "https://myurl.com/api/pubmedia?mediaid=${mediaurls[i]}",
httpHeaders: {auth:"123"},
placeholder: (context, url) => CircularProgressIndicator(),
errorWidget: (context, url, error) => Icon(Icons.error),
imageRenderMethodForWeb: ImageRenderMethodForWeb.HttpGet
)
On the server I wrote code to print out all the headers. Without “imageRenderMethodForWeb: ImageRenderMethodForWeb.HttpGet” the headers are NOT passed at all. So that seems like a bug. With imageRenderMethodForWeb it prints the header key as a value in another header so
HTTP_ACCESS_CONTROL_REQUEST_HEADERS: auth
and “123” is not included anywhere in the header information. Additionally if I include the headers, the widget gets stuck loading the image forever and never returns. Right now my server doesn’t do anything with the headers besides prints them so the images load perfect without the headers or withouth imageRenderMethodForWeb. The exact same thing happens with CachedNetworkImageProvider and the “headers” parameter.
My question is why is it using the header key auth (its a string above) and inserting it into the value field “HTTP_ACCESS_CONTROL_REQUEST_HEADERS” and why does it discard the “123” and why does it never complete when the header is provided?
Thank you in advance for any insight.