Skip to content

Commit

Permalink
Fix RocketChat web handler
Browse files Browse the repository at this point in the history
  • Loading branch information
rowanseymour committed Nov 11, 2022
1 parent 7268a1e commit 7afc8ed
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions services/tickets/rocketchat/web.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func handleEventCallback(ctx context.Context, rt *runtime.Runtime, r *http.Reque
}

request := &eventCallbackRequest{}
if err := utils.UnmarshalAndValidateWithLimit(r.Body, request, web.MaxRequestBytes); err != nil {
if err := web.ReadAndValidateJSON(r, request); err != nil {
return err, http.StatusBadRequest, nil
}

Expand Down Expand Up @@ -90,11 +90,6 @@ func handleEventCallback(ctx context.Context, rt *runtime.Runtime, r *http.Reque
}
}

var attachments []string
for _, attachment := range data.Attachments {
attachments = append(attachments, attachment.URL)
}

_, err = tickets.SendReply(ctx, rt, ticket, data.Text, files)

case "close-room":
Expand Down

0 comments on commit 7afc8ed

Please # to comment.