-
Notifications
You must be signed in to change notification settings - Fork 27.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix:(next/image) handle
remotePatterns
with a dot in the pathname (#…
…60488) ### Fixing a bug ### What? Fix remotePatterns when all paths and/or domains are allowed. ### Why? micromatch creates a very strange regex for all paths - `/^(?:(?!\.)(?:(?:(?!(?:^|[\\/])\.).)*?)[\\/]?)$/`. That is, paths cannot start with a dot or contain a slash followed by a dot. Interestingly, here are some valid paths: - /a/a.a/6a00d8341c4fbe53ef02c8d3a82122200d-600wi - ////a/a.a/6a00d8341c4fbe53ef02c8d3a82122200d-600wi - ///:?%;№%/a/a.a/6a00d8341c4fbe53ef02c8d3a82122200d-600wi.\/ - /:./6a00d8341c4fbe53ef02c8d3a82122200d-600wi.\/ And here are some invalid ones: - /.a/6a00d8341c4fbe53ef02c8d3a82122200d-600wi - /a/.a/6a00d8341c4fbe53ef02c8d3a82122200d-600wi - ./a/6a00d8341c4fbe53ef02c8d3a82122200d-600wi I don't think this check makes any sense. ### How? If the user allows all (`**`) - it means any path or domain will be considered valid. - Fixes #60483 - Fixes #58139 - Fixes #46903 --------- Co-authored-by: Steven <steven@ceriously.com>
- Loading branch information
Showing
3 changed files
with
9 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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