Skip to content

Commit e08eb11

Browse files
committed
Validate the same request body parameter cannot be specified multiple times
1 parent 68c1c49 commit e08eb11

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

encoder.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ func encodeTriggerBody(
5555
"data": payloadData,
5656
}
5757
for k, v := range params {
58+
if _, ok := eventPayload[k]; ok {
59+
return nil, errors.New(fmt.Sprintf("Paramater %s specified multiple times", k))
60+
}
5861
eventPayload[k] = v
5962
}
6063
return json.Marshal(eventPayload)

0 commit comments

Comments
 (0)