Welcome! Log In Create A New Profile

Advanced

Re: post body

August 08, 2018 03:00PM
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.

regards,
Dk

On Wed, Aug 8, 2018 at 11:34 AM Maxim Dounin <mdounin@mdounin.ru> wrote:

> Hello!
>
> 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
> request
> > > should be allowed to proceed to origin server or not. Based on the
> examples
> > > I could find I've coded this in my module. After some trial and error
> it
> > > 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.
> Thanks.
>
> You may want to read general request body reading guidelines here:
>
> http://nginx.org/en/docs/dev/development_guide.html#http_request_body
>
> 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:
>
>
> http://mdounin.ru/hg/ngx_http_catch_body_filter_module/file/tip/ngx_http_catch_body_filter_module.c
>
> --
> Maxim Dounin
> http://mdounin.ru/
> _______________________________________________
> nginx-devel mailing list
> nginx-devel@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx-devel
>
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

post body

dnj0496 1077 August 02, 2018 03:32PM

Re: post body

dnj0496 555 August 08, 2018 01:48AM

Re: post body

Maxim Dounin 406 August 08, 2018 02:36PM

Re: post body

dnj0496 544 August 08, 2018 03:00PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 248
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