dnj0496 at gmail.com
Wed Aug 8 18:57:33 UTC 2018
Thank you. Will looking it and get back. Since I need to inspect, I'll
follow your suggestion
and see if I can use the body filter option.
On Wed, Aug 8, 2018 at 11:34 AM Maxim Dounin <mdounin at mdounin.ru> wrote:
> On Tue, Aug 07, 2018 at 10:46:08PM -0700, Dk Jack wrote:
> > Haven't received any response to inquiry. Would appreciate it if someone
> > can comment.
> > > In my module, I'd like to look into the post body to decide if the
> > > should be allowed to proceed to origin server or not. Based on the
> > > I could find I've coded this in my module. After some trial and error
> > > seems to be working. I am not sure if my implementation is 100%
> correct. I
> > > would appreciate it if someone can go over my code below and let me
> know if
> > > my implementation is correct. Especially, the body_complete_handler.
> You may want to read general request body reading guidelines here:
> Your code suggests you've never seen these guidelines, so consider
> re-writing it after reading the above link.
> Note that the above guidelines cover content phase handling. In
> other request processing phases reqding the request body might be
> tricky and will require additional handling (if at all possible).
> In particular, you'll have to restore request phases processing
> after the call, and you might have to call
> ngx_http_finalize_request() yourself. Consider looking into
> src/http/modules/ngx_http_mirror_module.c for an example. Note
> well that required handling might depend on the exact request
> processing phase you are trying to use.
> Note well that if you are trying to inspec the request body,
> writing a request body filter might be a better solution. See
> here for a trivial example:
> Maxim Dounin
> nginx-devel mailing list
> nginx-devel at nginx.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the nginx-devel