Skip to content

fix: workaround for a cloudfront issue where it throws on a 403 #47

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

Merged
merged 1 commit into from
Sep 21, 2023

Conversation

lukasholzer
Copy link
Contributor

@lukasholzer lukasholzer commented Sep 21, 2023

🎉 Thanks for sending this pull request! 🎉

Temp fix for: https://github.com/netlify/pod-dev-foundations/issues/592
Currently, if we hit Cloudfront with a nonexisting blob storage key it returns a wrong status code.
Instead of providing a 404 (Not found), it returns a 403 (Access denied).

This is not ideal, we are using the status code to determine if it should throw or not. A 404 just returns null which means nothing found but all fine.

This fix makes it behave similar on a build plugin or during request time

@lukasholzer lukasholzer requested a review from a team as a code owner September 21, 2023 13:49
@netlify
Copy link

netlify bot commented Sep 21, 2023

Deploy Preview for blobs-js ready!

Name Link
🔨 Latest commit c0fd160
🔍 Latest deploy log https://app.netlify.com/sites/blobs-js/deploys/650c49f61990330008ec1062
😎 Deploy Preview https://deploy-preview-47--blobs-js.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@github-actions github-actions bot added the type: bug code to address defects in shipped code label Sep 21, 2023
Copy link

@mraerino mraerino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you cut an issue to revert this once we found a better fix in cloudfront?

@lukasholzer
Copy link
Contributor Author

@mraerino sure I'm adding it to the linked issue :)

@lukasholzer lukasholzer merged commit d29242b into main Sep 21, 2023
@eduardoboucas eduardoboucas deleted the fix/dont-throw-on-403-status-code branch October 24, 2023 10:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug code to address defects in shipped code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants