Skip to content

Commit

Permalink
limit the response to 200 chars
Browse files Browse the repository at this point in the history
  • Loading branch information
kashifkhan0771 committed Oct 22, 2024
1 parent 6dc944a commit 36c6519
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/custom_detectors/custom_detectors.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,10 @@ func (c *CustomRegexWebhook) createResults(ctx context.Context, match map[string

// TODO: handle different content-type responses seperatly when implement custom detector configurations
responseStr := string(body)
// truncate to 200 characters if response length exceeds 200
if len(responseStr) > 200 {
responseStr = responseStr[:200]
}

// store the processed response in ExtraData
result.ExtraData["response"] = responseStr
Expand Down

0 comments on commit 36c6519

Please sign in to comment.