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: handle empty content-type header #9

Merged
merged 1 commit into from
Mar 10, 2022
Merged

Conversation

ascorbic
Copy link

@ascorbic ascorbic commented Mar 10, 2022

Currently we check the content-type header when loading the source image, to confirm that it is an image. However this was failing, causing bugs such as opennextjs/opennextjs-netlify#1220 and Blazity/next-image-proxy#1
This PR causes the server to ignore missing content-type headers, and rely on sharp to check that the source is an image. It still checks content types if the headers is sent.

Fixes #2

@ascorbic ascorbic self-assigned this Mar 10, 2022
@ascorbic ascorbic added the type: bug code to address defects in shipped code label Mar 10, 2022
Copy link

@jackbrewer jackbrewer left a comment

Choose a reason for hiding this comment

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

LGTM! 🚀

@ascorbic ascorbic merged commit 2650b33 into main Mar 10, 2022
@ascorbic ascorbic deleted the mk/empty-content-type branch March 10, 2022 14:36
@kitop kitop added the echoes/intent: customer-value End-user visible changes intended to create customer value label Mar 11, 2022
@aureliendebord
Copy link

Hello,
Upgrading to the last version of next + last version of the plugin, the problem is still here.
Is here any other updates or fix to deploy?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
echoes/intent: customer-value End-user visible changes intended to create customer value type: bug code to address defects in shipped code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Problem with images loaded from external sources without content-type header
4 participants