Open taoky opened 1 year ago
Hello, the designer/builder of the https://mirrors.help here.
We found out about the issue when we were building the sie. You can also reproduce the error on our site:
GDB Git
in the navigation menuGDB Git
, the address becomes https://help.mirrorz.org/binutils-gdb.git
https://help.mirrorz.org/binutils-gdb.git
becomes 404/
at the end of the address (https://help.mirrorz.org/binutils-gdb.git/
) will the page be backI have worked out a demo to show this bug:
It also shows that this bug affects router.push()
. Source code is at the gh-demo
branch: https://github.com/taoky-playground/nextjs-remove-trailing-with-dot-bug/tree/gh-demo
Reproduction:
b.git/
link or button on https://nextjs-remove-trailing-with-dot-bug.pages.dev/Possible related issue at Cloudflare side: https://github.com/cloudflare/workers-sdk/issues/2779
Link to the code that reproduces this issue
https://github.com/taoky-playground/nextjs-remove-trailing-with-dot-bug
To Reproduce
next export
yarn build
index.html
:While:
Current vs. Expected behavior
Current:
<a href="/b.git">b.git/</a>
Expected:
<a href="/b.git/">b.git/</a>
Verify canary release
Provide environment information
Which area(s) are affected? (Select all that apply)
Routing (next/router, next/navigation, next/link)
Additional context
Related (they are all locked):
It is fundamentally broken to "detect file" by checking whether it has a
.
or not -- this is not a Windows-only world, after all. Although most HTTP server could help redirect to the URL with a trailing slash:Thus I believe that https://github.com/vercel/next.js/blob/3eadfe925bb49e116f1b97d81a1d51fa0e33166d/packages/next/src/client/normalize-trailing-slash.ts#L15 shall be removed (who will intentionally put a trailing slash after a file?).