How to use images requiring header authorization with image resizing worker?


So according to CF image resizing docs, the image resizing worker do not support image requests which require header authorizations or cookies:

However, our service requires this in order to fetch the images. If this cannot be done in any way directly through the image resizing worker. What is the best way to workaround this?

I have seen suggestions of creating another non-image resizing worker just to fetch the images from origin servers then fetch this to the image resizing worker. Other suggestion includes implementing sign request.

Anyone have any other more straightforward ways of doing this?

So for example, the code below will not work because the the fetch requires header, but cf image resizing does not allow this directly.

addEventListener("fetch", event => {

function handleRequest(request) {
return fetch('', {
headers: {
'Authorization': 'some header authorization info here...',
cf: {
image: {
fit: 'cover',
width: 300,
height: 300,