Nested Image resizing fetch requests not setting cdn-loop header


We are using Cloudflare image resizing in workers to resize images on-demand. One of the sources is Shopify CDN (example:

It looks like Shopify is using Cloudflare as well, and for whatever reason, they are responding with a 403 when a fetch is made without the cdn-loop header set in the request. Obviously, Cloudflare doesn’t allow to manually set that header, so what I’ve tried to do instead is repeat the fetch request in hopes that Cloudflare would then set it to cloudflare; subreqs=1, but that didn’t happen. if I just nest a normal fetch without the cf.image options (so without resizing), Cloudflare correctly sets the header.

I understand it’s not Cloudflare’s fault Shopify weirdly returns 403 when the header is not set, but I do wonder if it’s expected that Cloudflare workers are not setting the header for nested image resizing fetches (but they do for non-resizing requests)?


Hi, this is a known issue of 2 different products not working together: Images Transformations and BYOIP Bringing Your Own IPs to Cloudflare · Cloudflare BYOIP docs

as for now, you can use Cloudflare Images product using built-in storage and delivery zone Serve uploaded images · Cloudflare Image Optimization docs

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.