Skip to content

Find, verify, and analyze leaked credentials

Add default Content-Type: application/json header for custom detector verification request (#4947)

Muneeb Ullah Khan90ca685b33dd
diff --git a/pkg/custom_detectors/custom_detectors.go b/pkg/custom_detectors/custom_detectors.go
index 6a9e7a39f..b8f6a3127 100644
--- a/pkg/custom_detectors/custom_detectors.go
+++ b/pkg/custom_detectors/custom_detectors.go
@@ -293,6 +293,9 @@ func (c *CustomRegexWebhook) createResults(ctx context.Context, match map[string
}
req.Header.Add(key, strings.TrimLeft(value, "\t\n\v\f\r "))
}
+ if req.Header.Get("Content-Type") == "" {
+ req.Header.Set("Content-Type", "application/json")
+ }
resp, err := httpClient.Do(req)
if err != nil {
continue