-
Notifications
You must be signed in to change notification settings - Fork 28k
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Allow image optimization on wildcard hostnames #18632
Comments
We can’t let people disable it as it would allow you to get 3 types of attack vectors: We can consider wildcard support though 👍 |
Consider this case:
So I'd like to propose the following: either: fallback to the basic HTML module.exports = {
images: {
domains: ['domain1.com', 'domain2.com'],
fallback: true,
},
} OR: allow users to explicitly opt-in to allowing all domains by setting something like module.exports = {
images: {
domains: [],
dangerouslyAllowAllDomains: true,
},
} but this doesn't seem to be the the plan. |
Both sound great. It’d be really great to have frontend/CSS consistency regardless of the image host, so the |
yep, facing same problem since we are using S3 which has variant of domains , wildcards would be awesome idea |
This comment has been minimized.
This comment has been minimized.
…#36245) ## Description This PR implements a new configuration object in `next.config.js` called `experimental.images.remotePatterns`. This will eventually deprecate `images.domains` because it covers the same use cases and more by allowing wildcard pattern matching on `hostname` and `pathname` and also allows restricting `protocol` and `port`. ## Feature - [x] Implements an existing feature request. - [x] Related issues linked - [x] Unit tests added - [x] Integration tests added - [x] Documentation added - [x] Telemetry added. In case of a feature if it's used or not. - [x] Errors have helpful link attached, see `contributing.md` ## Related - Fixes #27925 - Closes #18429 - Closes #18632 - Closes #18730 - Closes #27345
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
On https://workshops.hackclub.com, to prevent ballooning the already-multiple-GBs source repo, we have folks upload images/media to the Vercel CDN as individual deployments (using some internal tooling) so the dev experience is faster. However, this means each image is at a different hostname. I’d love to switch our homepage there to use Next.js Image Optimization, but since each image is on a different/unknown domain, we can’t. Two solutions jump out to me:
domains
restriction entirely (opening your site up to being used as an external service)cloud-*.vercel.app
would work fine)—a little more technically/usage complex but is definitely saferThe text was updated successfully, but these errors were encountered: