-
-
Notifications
You must be signed in to change notification settings - Fork 231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
experimental: UseRequest/ResponseBody methods #1212
base: main
Are you sure you want to change the base?
Conversation
My only concern is maintaining a pointer that can be flushed at any point. |
da2c87a
to
b0f4323
Compare
Hey, I elaborated on the description a bit more. However, this feature fundamentally relies on this approach, so I would assume that anyone using it is intentionally willing to let Coraza the ownership of that pointer |
I am missing the use cases where this can be used. In regular go code I think it is risky as mutations can happen, in other environments I think is more acceptable. I would not merge this until we show solid code using it. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1212 +/- ##
==========================================
+ Coverage 81.66% 81.69% +0.03%
==========================================
Files 168 168
Lines 9655 9737 +82
==========================================
+ Hits 7885 7955 +70
- Misses 1519 1527 +8
- Partials 251 255 +4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Exposing as experimental two new methods to provide the bodies to Coraza. They are meant to be used when the entire request body is available, as it avoids the need for an extra copy into the body buffers.
Benchmark:
Usage:
Usage: