1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Add NotFound handler (#18062) (#18067)

Backport #18062

PR #17997 means that urls with terminal '/' are no longer immediately mapped
to the url without a terminal slash. However, it has revealed that the NotFound handler
appears to have been lost.

This PR adds back in a NotFound handler that simply redirects to a path without the
terminal slash or runs the NotFound handler.

Fix #18060

Signed-off-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
zeripath
2021-12-22 15:26:37 +00:00
committed by GitHub
parent 6de75224de
commit 6100935a77
3 changed files with 21 additions and 1 deletions

View File

@@ -18,7 +18,7 @@ func TestSignOut(t *testing.T) {
session.MakeRequest(t, req, http.StatusFound)
// try to view a private repo, should fail
req = NewRequest(t, "GET", "/user2/repo2/")
req = NewRequest(t, "GET", "/user2/repo2")
session.MakeRequest(t, req, http.StatusNotFound)
// invalidate cached cookies for user2, for subsequent tests