Skip to content

Commit

Permalink
Merge pull request #6 from cblk/master
Browse files Browse the repository at this point in the history
fix(tonic): bind query and header
  • Loading branch information
lencyforce authored Jun 28, 2020
2 parents 393d1a6 + 766e5b0 commit 6f87a79
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tonic/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,21 @@ func Handler(h interface{}, status int, options ...func(*Route)) gin.HandlerFunc
handleError(c, bindError)
return
}
// Bind query-parameters.
if err := bind(c, input, QueryTag, extractQuery); err != nil {
handleError(c, err)
return
}
// Bind path arguments.
if err := bind(c, input, PathTag, extractPath); err != nil {
handleError(c, err)
return
}
// Bind headers.
if err := bind(c, input, HeaderTag, extractHeader); err != nil {
handleError(c, err)
return
}
// validating query and path inputs if they have a validate tag
initValidator()
args = append(args, input)
Expand Down

0 comments on commit 6f87a79

Please sign in to comment.