mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
### 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 <[email protected]>