Skip to content

fix: follow redirects when downloading a file from the CDN #1719

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 5 commits into from
Oct 26, 2022

Conversation

ericapisani
Copy link

@ericapisani ericapisani commented Oct 26, 2022

Summary

Uses the follow-redirects library to make the http request for downloading a file from the CDN.

In cases we where needed to follow the redirect initially returned we were instead failing the request, leading to 500 errors regarding missing files as seen in #1679

Test plan

Should be noted that the test site used above came from the user who reported the issue, I just forked it.

I haven't added automated tests here because I'd be essentially testing the package itself rather than functionality we've added.

Relevant links (GitHub issues, Notion docs, etc.) or a picture of cute animal

Fixes #1679

signal-2022-10-17-21-04-17-223

@ericapisani ericapisani added the type: bug code to address defects in shipped code label Oct 26, 2022
@ericapisani ericapisani self-assigned this Oct 26, 2022
@ericapisani ericapisani requested a review from a team October 26, 2022 18:35
@netlify
Copy link

netlify bot commented Oct 26, 2022

Deploy Preview for netlify-plugin-nextjs-nx-monorepo-demo ready!

Name Link
🔨 Latest commit 52992be
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-nx-monorepo-demo/deploys/63598d5f8ba9090009ca4408
😎 Deploy Preview https://deploy-preview-1719--netlify-plugin-nextjs-nx-monorepo-demo.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.

@netlify
Copy link

netlify bot commented Oct 26, 2022

Deploy Preview for netlify-plugin-nextjs-static-root-demo ready!

Name Link
🔨 Latest commit 52992be
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-static-root-demo/deploys/63598d5fec9db50009e3d815
😎 Deploy Preview https://deploy-preview-1719--netlify-plugin-nextjs-static-root-demo.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.

@netlify
Copy link

netlify bot commented Oct 26, 2022

Deploy Preview for next-i18next-demo failed.

Name Link
🔨 Latest commit f798f42
🔍 Latest deploy log https://app.netlify.com/sites/next-i18next-demo/deploys/63597dd893fe7b00081b0050

@netlify
Copy link

netlify bot commented Oct 26, 2022

Deploy Preview for netlify-plugin-nextjs-export-demo ready!

Name Link
🔨 Latest commit f798f42
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-export-demo/deploys/63597dd8cc3d210008c5f856
😎 Deploy Preview https://deploy-preview-1719--netlify-plugin-nextjs-export-demo.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.

@netlify
Copy link

netlify bot commented Oct 26, 2022

Deploy Preview for next-i18next-demo ready!

Name Link
🔨 Latest commit 508a756
🔍 Latest deploy log https://app.netlify.com/sites/next-i18next-demo/deploys/63597e3e8f513b000aed3c33
😎 Deploy Preview https://deploy-preview-1719--next-i18next-demo.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.

@netlify
Copy link

netlify bot commented Oct 26, 2022

Deploy Preview for netlify-plugin-nextjs-next-auth-demo ready!

Name Link
🔨 Latest commit f798f42
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-next-auth-demo/deploys/63597dd8f567dc0009f33d1f
😎 Deploy Preview https://deploy-preview-1719--netlify-plugin-nextjs-next-auth-demo.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.

@netlify
Copy link

netlify bot commented Oct 26, 2022

Deploy Preview for next-plugin-edge-middleware ready!

Name Link
🔨 Latest commit f798f42
🔍 Latest deploy log https://app.netlify.com/sites/next-plugin-edge-middleware/deploys/63597dd8f0093f00083f4939
😎 Deploy Preview https://deploy-preview-1719--next-plugin-edge-middleware.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.

@netlify
Copy link

netlify bot commented Oct 26, 2022

Deploy Preview for netlify-plugin-nextjs-export-demo ready!

Name Link
🔨 Latest commit 52992be
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-export-demo/deploys/63598d5f8165430009b8c3c7
😎 Deploy Preview https://deploy-preview-1719--netlify-plugin-nextjs-export-demo.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.

@netlify
Copy link

netlify bot commented Oct 26, 2022

Deploy Preview for netlify-plugin-nextjs-next-auth-demo ready!

Name Link
🔨 Latest commit 52992be
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-next-auth-demo/deploys/63598d5f1e68c600099847bb
😎 Deploy Preview https://deploy-preview-1719--netlify-plugin-nextjs-next-auth-demo.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.

@netlify
Copy link

netlify bot commented Oct 26, 2022

Deploy Preview for next-i18next-demo ready!

Name Link
🔨 Latest commit 52992be
🔍 Latest deploy log https://app.netlify.com/sites/next-i18next-demo/deploys/63598d5fc98fdd000864269b
😎 Deploy Preview https://deploy-preview-1719--next-i18next-demo.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.

@netlify
Copy link

netlify bot commented Oct 26, 2022

Deploy Preview for nextjs-plugin-custom-routes-demo ready!

Name Link
🔨 Latest commit f798f42
🔍 Latest deploy log https://app.netlify.com/sites/nextjs-plugin-custom-routes-demo/deploys/63597dd890c0c0000775a414
😎 Deploy Preview https://deploy-preview-1719--nextjs-plugin-custom-routes-demo.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.

@netlify
Copy link

netlify bot commented Oct 26, 2022

Deploy Preview for next-plugin-canary ready!

Name Link
🔨 Latest commit f798f42
🔍 Latest deploy log https://app.netlify.com/sites/next-plugin-canary/deploys/63597dd89cd14e0008ab5500
😎 Deploy Preview https://deploy-preview-1719--next-plugin-canary.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.

@netlify
Copy link

netlify bot commented Oct 26, 2022

Deploy Preview for netlify-plugin-nextjs-demo ready!

Name Link
🔨 Latest commit f798f42
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-demo/deploys/63597dd828a4440008d6d4b7
😎 Deploy Preview https://deploy-preview-1719--netlify-plugin-nextjs-demo.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.

@netlify
Copy link

netlify bot commented Oct 26, 2022

Deploy Preview for next-plugin-edge-middleware ready!

Name Link
🔨 Latest commit 52992be
🔍 Latest deploy log https://app.netlify.com/sites/next-plugin-edge-middleware/deploys/63598d5f6517e10007274b95
😎 Deploy Preview https://deploy-preview-1719--next-plugin-edge-middleware.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.

@netlify
Copy link

netlify bot commented Oct 26, 2022

Deploy Preview for nextjs-plugin-custom-routes-demo ready!

Name Link
🔨 Latest commit 52992be
🔍 Latest deploy log https://app.netlify.com/sites/nextjs-plugin-custom-routes-demo/deploys/63598d5f6517e10007274b9a
😎 Deploy Preview https://deploy-preview-1719--nextjs-plugin-custom-routes-demo.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.

@netlify
Copy link

netlify bot commented Oct 26, 2022

Deploy Preview for next-plugin-canary ready!

Name Link
🔨 Latest commit 52992be
🔍 Latest deploy log https://app.netlify.com/sites/next-plugin-canary/deploys/63598d5f5db7510009818b20
😎 Deploy Preview https://deploy-preview-1719--next-plugin-canary.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.

@netlify
Copy link

netlify bot commented Oct 26, 2022

Deploy Preview for netlify-plugin-nextjs-demo ready!

Name Link
🔨 Latest commit 52992be
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-demo/deploys/63598d5f30707b0008eb2b93
😎 Deploy Preview https://deploy-preview-1719--netlify-plugin-nextjs-demo.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.

Copy link

@nickytonline nickytonline left a comment

Choose a reason for hiding this comment

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

Looks great! 🚀

@kodiakhq kodiakhq bot merged commit 1d27a99 into main Oct 26, 2022
@kodiakhq kodiakhq bot deleted the ep/1679-follow-redirects-in-handler branch October 26, 2022 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge type: bug code to address defects in shipped code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: NextAuth basic middleware causes 500 internal error on all page .json file requests
2 participants