mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-28 16:47:01 +09:00
refactor: http request binding (#38971)
Better than before, still not good enough (more work can be done in the future) And add the missing error handling in the PrivateContext "bind" middleware. By the way, picked some "TrimSpace" changes from "fix: trim whitespace from SMTP address and port - #38934" (fix #38926)
This commit is contained in:
1 parent
6c425fae6e
commit
6904f6480c
21 files changed
+265
-419
No files matched your search
@@ -4,20 +4,14 @@
|
||||
package structs
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"gitea.dev/modules/reqctx"
|
||||
"gitea.dev/modules/translation/i18n"
|
||||
|
||||
"gitea.com/go-chi/binding"
|
||||
"gitea.com/go-chi/binding" //nolint:depguard // avoid cycle import
|
||||
)
|
||||
|
||||
// ValidateContext is a special context for form validation middleware
|
||||
type ValidateContext struct {
|
||||
Locale i18n.LocaleTranslation
|
||||
Data reqctx.ContextData
|
||||
Req *http.Request
|
||||
Resp http.ResponseWriter
|
||||
}
|
||||
|
||||
type FormDefaultValidator struct{}
|
||||
|
||||
Reference in new issue
Block a user