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
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user