File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ type ModuleConfig struct {
47
47
anomalyDuration time.Duration
48
48
anomalySize int64
49
49
expectedContentTypes []string
50
+ extendContentTypes bool
50
51
debug bool
51
52
rawHeaderExtractor RawHeaderExtractorFunc
52
53
inspector Inspector
@@ -278,6 +279,15 @@ func ExpectedContentType(s string) ModuleConfigOption {
278
279
}
279
280
}
280
281
282
+ // ExtendContentTypes is a function argument to indicate that send request body
283
+ // of any content-type to the agent for inspection
284
+ func ExtendContentTypes (v bool ) ModuleConfigOption {
285
+ return func (c * ModuleConfig ) error {
286
+ c .extendContentTypes = v
287
+ return nil
288
+ }
289
+ }
290
+
281
291
// CustomInspector is a function argument that sets a custom inspector,
282
292
// an optional inspector initializer to decide if inspection should occur, and
283
293
// an optional inspector finalizer that can perform any post-inspection steps
Original file line number Diff line number Diff line change @@ -385,6 +385,10 @@ func shouldReadBody(req *http.Request, m *Module) bool {
385
385
return true
386
386
}
387
387
388
+ if m .config .extendContentTypes {
389
+ return true
390
+ }
391
+
388
392
// read the body if there are multiple Content-Type headers
389
393
if len (req .Header .Values ("Content-Type" )) > 1 {
390
394
return true
You can’t perform that action at this time.
0 commit comments