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

fix: bypass on error #35

Merged
merged 1 commit into from
Jun 13, 2023
Merged

fix: bypass on error #35

merged 1 commit into from
Jun 13, 2023

Conversation

jasonbarry
Copy link

@jasonbarry jasonbarry commented Jun 13, 2023

This PR adds onError: "bypass" so that if the edge function fails for whatever reason, the unadulterated HTML is still served instead of completely erroring out (progressive enhancement vs strict failover)

Also adds a check for the request.headers.get("sec-fetch-dest") === "document" request header to be a bit more permissive when transforming responses.

@netlify
Copy link

netlify bot commented Jun 13, 2023

Deploy Preview for csp-nonce ready!

Name Link
🔨 Latest commit d5cecc2
🔍 Latest deploy log https://app.netlify.com/sites/csp-nonce/deploys/6488972899c9d9000811f0b4
😎 Deploy Preview https://deploy-preview-35--csp-nonce.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 settings.

@jasonbarry jasonbarry merged commit 6052a96 into main Jun 13, 2023
@jasonbarry jasonbarry deleted the fix/on-error-bypass branch June 13, 2023 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant