You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Closing this PR in favor of a new implementation that more closely matches Next.js behavior.
The approach here (adding image/svg+xml to SAFE_IMAGE_CONTENT_TYPES unconditionally) would allow SVGs through the image optimization endpoint by default. In Next.js, SVGs are blocked by default and require an explicit dangerouslyAllowSVG: true in the images config to opt in. This is an intentional security measure since SVGs can contain embedded JavaScript.
Next.js's actual default behavior for .svg sources is to automatically set unoptimized = true on the client side, so the image is served directly without ever hitting the optimization endpoint. The dangerouslyAllowSVG config is only needed for edge cases (SVG URLs without a .svg extension, or when you want the proxy/caching/security-header behavior).
The new PR will implement the full Next.js SVG handling: auto-skip for .svg sources, dangerouslyAllowSVG opt-in, contentDispositionType, and contentSecurityPolicy config options.
Thank you for the contribution and for identifying this issue!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi, could you please approve the workflows so the checks can run?
Resolves #205 Fixes #205