diff --git a/services/tickets/rocketchat/web.go b/services/tickets/rocketchat/web.go index 286de0cf2..68a99247d 100644 --- a/services/tickets/rocketchat/web.go +++ b/services/tickets/rocketchat/web.go @@ -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 } @@ -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":