Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Miniflare gets a 403 on Images when passing request #97

Closed
WalshyDev opened this issue Nov 18, 2021 · 2 comments
Closed

Miniflare gets a 403 on Images when passing request #97

WalshyDev opened this issue Nov 18, 2021 · 2 comments
Labels
bug Something isn't working fixed-in-next Fixed in next release

Comments

@WalshyDev
Copy link
Member

WalshyDev commented Nov 18, 2021

When calling fetch with Request or even an object with the Request headers ({ heders: request.headers }) returns a 403 on Images.

Running this code with Miniflare works as intended. It will fetch the image perfectly fine.

export default {
  fetch(req) {
    return fetch('https://imagedelivery.net/ZWd9g1K7eljCn_KDTu_MWA/083eb7b2-5392-4565-b69e-aff66acddd00/public');
  }
}

Running this code... returns a 403

export default {
  fetch(req) {
    return fetch('https://imagedelivery.net/ZWd9g1K7eljCn_KDTu_MWA/083eb7b2-5392-4565-b69e-aff66acddd00/public', req);
  }
}

image


I'm not sure what exactly in Miniflare or Images is causing this. It works perfectly fine if deployed. Seems some headers are just not being stripped properly and CF denies that.

Miniflare version: 2.0.0-rc.1

@mrbbot
Copy link
Contributor

mrbbot commented Nov 20, 2021

Hey! 👋 Looks like this was due to the Host and CF-Connecting-IP headers included when fetching. Will be fixed in the next release. 👍

@mrbbot mrbbot added bug Something isn't working fixed-in-next Fixed in next release labels Nov 20, 2021
@mrbbot
Copy link
Contributor

mrbbot commented Nov 22, 2021

Hey! 👋 miniflare@2.0.0-rc.2 has just been released, including the fix for this. You can find the changelog here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed-in-next Fixed in next release
Projects
None yet
Development

No branches or pull requests

2 participants