The filter options look designed to allow you to have different configurations per endpoint. However, the filters are applied after the request/response recording is set up. Therefore:
slogchi.NewWithConfig(slog, slogchi.Config{
WithRequestBody: true,
Filters: []slogchi.Filter{ slogchi.AcceptPathPrefix("/foo") },
})
slogchi.NewWithConfig(slog, slogchi.Config{
WithRequestBody: true,
Filters: []slogchi.Filter{ slogchi.AcceptPathPrefix("/bar") },
})
will result in two copies of request body being buffered for every request, regardless of whether it matches the filters.
I see 9501154, but this is still applied after the request is mutated with new reader/writers. I think filters should be processed here before the r.Body code is run.
The filter options look designed to allow you to have different configurations per endpoint. However, the filters are applied after the request/response recording is set up. Therefore:
will result in two copies of request body being buffered for every request, regardless of whether it matches the filters.
I see 9501154, but this is still applied after the request is mutated with new reader/writers. I think filters should be processed here before the
r.Bodycode is run.