Skip to content

Commit

Permalink
Return an error if repeating variable is present in the query string …
Browse files Browse the repository at this point in the history
…with explode disabled.
  • Loading branch information
wI2L committed Jan 29, 2019
1 parent ad613c3 commit 7b3b9ed
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tonic/tonic.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,9 @@ func extractQuery(c *gin.Context, tag string) (string, []string, error) {
splitFn := func(c rune) bool {
return c == ','
}
if len(query) > 0 {
if len(query) > 1 {
return name, nil, fmt.Errorf("multiple values in querystring with explode disabled")
} else if len(query) == 1 {
params = strings.FieldsFunc(query[0], splitFn)
}
}
Expand Down

0 comments on commit 7b3b9ed

Please sign in to comment.