Welcome! Log In Create A New Profile

Advanced

Any way to reset r->request_body to avoid conflicts between modules?

September 22, 2019 07:01PM
I have a preaccess filter in my module that loads in the request_body with `ngx_http_read_client_request_body` (it basically scans the buffer for security violations, no modifications). I don't discard the buffer and this module works fine when proxying POST requests or multiform data to a downstream reverse proxy.

If I try using a lua module that attempts to read the request body, too (like `resty.upload`), the module complains that request->request_body already exists and it cannot proceed.

Is there any way to reset request->request_body? Just for a laugh I tried setting it to 0 and of course that doesn't work. Barring that is there a way my module could read the request_body without causing a state change to the request struct?

Thanks
Subject Author Posted

Any way to reset r->request_body to avoid conflicts between modules?

ptcell September 22, 2019 07:01PM

Re: Any way to reset r->request_body to avoid conflicts between modules?

Maxim Dounin September 23, 2019 08:50AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 296
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready