forgejo/routers/common
Gusted cf157ab360
fix: always set stripped slashes on http request
- The middleware that takes care of normalizing '//user2/////repo1' to
`/user2/repo1` would only set the normalized value to the Chi (Forgejo's
http router) `RoutePath` field, so Chi would correctly do the routing.
However not all components in Forgejo (like Forgejo's `context` module)
rely on Chi to get this updated path and some still rely on the value of
`(http.Request).URL.Path`, so always set the normalized value to the
http request.
- Adjusted unit test.
- Resolves forgejo/forgejo#6822
- The related issue was caused by
751a3da979/services/context/context.go (L115)
using the value of the http request on not that was set in the Chi context.
2025-02-10 12:55:11 +01:00
..
auth.go Move context from modules to services (#29440) 2024-03-06 12:10:43 +08:00
compare.go feat(api): implement branch/commit comparison API (#30349) 2024-04-21 11:58:18 +02:00
db.go [PORT] Refactor the DB migration system slightly (gitea#32344) 2024-11-03 17:00:48 +01:00
errpage.go Move context from modules to services (#29440) 2024-03-06 12:10:43 +08:00
errpage_test.go Clean up template locale usage (#27856) 2023-10-31 22:11:48 +08:00
markup.go fix: Preview picture not visible on Markdown file (#5781) 2024-11-23 15:00:18 +00:00
middleware.go fix: always set stripped slashes on http request 2025-02-10 12:55:11 +01:00
middleware_test.go fix: always set stripped slashes on http request 2025-02-10 12:55:11 +01:00
redirect.go Use fetch to send requests to create issues/comments (#25258) 2023-06-16 06:32:43 +00:00
serve.go Move context from modules to services (#29440) 2024-03-06 12:10:43 +08:00