Open ptim opened 2 years ago
Hey! ๐ Thanks for the feature request. I think if we were to do this, it would be emulation to keep Miniflare's fully-local promise. I'll ask some people internally about the resizing headers/errors. ๐
Hey! ๐ Thanks for raising this issue. I'm going to transfer this to workers-sdk
as that's the new home for Miniflare 3, and that will make it easier for us to track this. ๐
Hi! Thanks for miniflare - life saver ๐
I'm developing various image resizing APIs for our site, and have a tough time testing the functionality locally because the current behaviour is that requests for image-resizing currently silently pass through to the original image, rather than returning a transformed response.
This FR is about being able to test business logic locally, especially with respect to some of the behaviours of image-resizing (headers, error conditions) which are not documented anywhere that I'm aware of, and can currently only be discovered via wrangler dev or deployment.
An ideal result would be if the
miniflare.upstream
property (or similar) could nominate a live zone, to which image-resizing requests would be delegated (to get a live response).If this 'upstream delegation' is not possible, then it would be good to:
If emulation, rather than delegation were chosen, then I would not expect images to be returned in the same size or quality as live workers would return, but I think 'content-type' is important.
Image resizing response headers (anecdotal)
ref: https://github.com/cloudflare/wrangler2/issues/534#issuecomment-1079258053
Image resizing errors (anecdotal)
Related: AVIF size limit - Developers / Workers - Cloudflare Community
Response body:
Discord thread: