Cloudflare Workers Image Resizing Parameters Ignored

Hi there,

I have some images stored on S3, and i’ve followed the example to hide the URL:
https://developers.cloudflare.com/images/image-resizing/control-origin-access/#hiding-the-image-server

Everything is working great, but it seems the URL parameters are being ignored.

Here is my workers code, which is basically identical to the example:

addEventListener("fetch", event => {
  event.respondWith(handleRequest(event.request))
})

async function handleRequest(request) {
  const hiddenImageOrigin = "https://s3.ap-southeast-2.amazonaws.com/mybucket"

  const requestURL = new URL(request.url)

  const resizingOptions = {
    width: requestURL.searchParams.get("width"),
  }
  
  const imageURL = hiddenImageOrigin + requestURL.pathname

  console.log(imageURL)

  return fetch(imageURL, {cf:{image:resizingOptions}})
}

When i request it like this:

https://myworker.caching.workers.dev/some-image.jpg?width=424

The image is returned, but the width parameter is ignored.

What am i doing wrong? Is that documentation example wrong?

Got it. Its because i hadnt setup a path for the trigger. I didn’t know this was required, to get this working. I thought that was only optional, if i wanted to set it up on our actual domain (and not the workers default domain).