refactor: move go-chi/binding into Gitea (#39528)

The `gitea.com/go-chi/binding` package only exists for Gitea, so it
moves into `modules/web/binding` to fix its bugs directly. Split out of
https://github.com/go-gitea/gitea/pull/39504.

- GET and HEAD always bind the query
- JSON `null` slice elements and nested `TrimSpace` fields bind
correctly
- Integer fields reject out-of-range values instead of wrapping
- An empty JSON body binds nothing and an unknown binding rule is an
error

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: bircni <bircni@icloud.com>
This commit is contained in:
silverwind
2026-10-02 15:37:41 +02:00
committed by GitHub
parent 2f01ec38bd
commit e6ffbea888
17 changed files with 748 additions and 72 deletions
-2
View File
@@ -527,10 +527,8 @@
"form.SSPISeparatorReplacement": "Separator",
"form.SSPIDefaultLanguage": "Default Language",
"form.require_error": "%s cannot be empty.",
"form.alpha_dash_error": "%s should contain only alphanumeric, dash ('-') and underscore ('_') characters.",
"form.alpha_dash_dot_error": "%s should contain only alphanumeric, dash ('-'), underscore ('_') and dot ('.') characters.",
"form.git_ref_name_error": "%s must be a well-formed Git reference name.",
"form.size_error": "%[1]s must be size %[2]s.",
"form.min_size_error": "%[1]s must contain at least %[2]s characters.",
"form.max_size_error": "%[1]s must contain at most %[2]s characters.",
"form.range_error": "%[1]s must be a number from %[2]s to %[3]s.",