lauri
lauri
CDCloudflare Developers
Created by lauri on 10/18/2024 in #general-help
ERROR 9519: Could not fetch the image — the server returned HTTP error 522 <unknown status code>
I'm trying to resize an image with cloudflare workers. Works fine on production, but gives an undocumented error when the images is on *.pages.dev domain.
const imageRequest = new Request(imgUrl, {
headers: request.headers,
});

const response = await fetch(imageRequest, {
cf: {
image: {
width: 1000,
height: 1000,
metadata: "none",
}
},
});
const imageRequest = new Request(imgUrl, {
headers: request.headers,
});

const response = await fetch(imageRequest, {
cf: {
image: {
width: 1000,
height: 1000,
metadata: "none",
}
},
});
Would love to have a parity between deployment previews and production deployments.
5 replies