next-image-export-optimizer
next-image-export-optimizer copied to clipboard
Adding custom options when fetching remote images
Could you add a way to add custom option to the HTTP requests made when downloading remote images?
I have some images hosted on internal servers. To fetch these, custom headers must be set. As far as I can tell, there is no way to provide these headers - apart from monkeypatching shenanigans.
I figure the most versatile implementation would be to enable remoteOptimizedImages.js
to return these options with each URL, since they might not be the same for all remote images.
Hi @mmarseu,
Let me think about this. In general, the remote image feature needs more work and I will have a look how this could be implemented.
I just enabled the functionality of query params in remote images. Would that be enough for your use case?
It's always great to see progress but unfortunately no. In my case, I really need to set custom headers for the image request.
Hi @mmarseu,
I created a PR with a proposal for this functionality: #223
If you have time, you could check it out and give your feedback.
Thanks, Niels