Can't get CF transform via workers to do anything

Following this guide: https://developers.cloudflare.com/images/transform-images/transform-via-workers/#an-example-worker
Using an unbelievably basic worker:
addEventListener('fetch', (event) => {
    event.respondWith(handleRequest(event.request));
});

async function handleRequest(request) {
    const url = new URL(request.url);
    const { pathname } = url;
    const imageURL = 'https://pub-d6b4cd812c4c423984abcb97395046d5.r2.dev' + pathname;

    const options = {
        cf: {
            image: {
                width: '100',
                height: '100',
                fit: 'cover',
            },
        },
    };

    const imageRequest = new Request(imageURL, { headers: request.headers });
    return fetch(imageRequest, options);
}


This doesn't seem to do anything, it just sends the full size image through. What am I doing wrong?
Cloudflare Docs
Using Cloudflare Workers to transform with a custom URL scheme gives you powerful programmatic control over every image request.
Was this page helpful?