mirror of
https://github.com/go-gitea/gitea.git
synced 2026-08-21 14:30:32 +00: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:
@@ -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