Skip to content

Commit

Permalink
Testing
Browse files Browse the repository at this point in the history
  • Loading branch information
dehort committed Sep 4, 2024
1 parent 8544661 commit 9ba0677
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion internal/validator/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,12 +163,20 @@ func (this *handler) validateContent(ctx context.Context, requestType string, da
events = &messageModel.ValidatedMessages{}
events.PlaybookType = requestType

truncateData := len(data) >= 1*1024*1024

lines := strings.Split(string(data), "\n")

for _, line := range lines {
for i, line := range lines {
if len(strings.TrimSpace(line)) == 0 {
continue
}

if truncateData && i > 2 && i < len(lines)-2 {
fmt.Println("Discarding line of output data...")
continue
}

if requestType == playbookSatPayloadHeaderValue {
err = validateWithSchema(ctx, this.schemas[1], true, line, events)
if err == nil {
Expand Down

0 comments on commit 9ba0677

Please sign in to comment.