Adding Content-Length to the response header of the image API
I'm experimenting with the image api. I would like to get the size of the image before downloading it to be able to calculate downloaded percentage from it.
Currently this is not possible as the api doesn't send the Content-Length in the header. Requesting the image https://images.igdb.com/igdb/image/upload/t_1080p_2x/ar4v3.jpg using Postman I have the below headers:
{
"Content-Type": "image/jpeg",
"Transfer-Encoding": "chunked",
"Connection": "keep-alive",
"Date": "Sat, 14 Sep 2024 04:14:23 GMT",
"X-Powered-By": "Express",
"X-Cache": "Hit from cloudfront",
"Via": "1.1 5d021d6d41ca50594efe62b14e574eda.cloudfront.net (CloudFront)",
"X-Amz-Cf-Pop": "BUD50-P2",
"Alt-Svc": "h3=":443"; ma=86400",
"X-Amz-Cf-Id": "_K3SRUbTV6eYzFKf5G1ZjLDA8O3LkYtjEPdIAnJVLS-cgdq7o4PSag==",
"Age": "2609",
"Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload",
"Cache-Control": "public, max-age=31536000, immutable",
"Vary": "Origin"
}
From the header X-Powered-By: Express I'm guessing these images are served using express. Is it possible to add Content-Length to the response header as well?
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Length