Skip to content

Commit 90ca685

Browse files
Add default Content-Type: application/json header for custom detector verification request (#4947)
* added content-type=application/json as default header * improv: set content type header when it is not present in the config * handled canonicalization
1 parent 5f47aad commit 90ca685

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

pkg/custom_detectors/custom_detectors.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,9 @@ func (c *CustomRegexWebhook) createResults(ctx context.Context, match map[string
293293
}
294294
req.Header.Add(key, strings.TrimLeft(value, "\t\n\v\f\r "))
295295
}
296+
if req.Header.Get("Content-Type") == "" {
297+
req.Header.Set("Content-Type", "application/json")
298+
}
296299
resp, err := httpClient.Do(req)
297300
if err != nil {
298301
continue

0 commit comments

Comments
 (0)