Skip to content

Commit

Permalink
Merge pull request #8 from gostalt/parse-form
Browse files Browse the repository at this point in the history
Call parse form if form has not been parsed already
  • Loading branch information
tmus authored Nov 22, 2019
2 parents e5e326b + 0b55cf3 commit 308ab32
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ func Check(r *http.Request, rule ...Rule) (Message, error) {
// passed into it. The rules argument is optional. Rules can
// be added by calling `Add` on the returned Validator.
func Make(r *http.Request, rule ...Rule) *Validator {
if r.Form == nil {
r.ParseForm()
}

return &Validator{
request: r,
Rules: rule,
Expand Down

0 comments on commit 308ab32

Please sign in to comment.