Hello!
On Thu, Jan 28, 2016 at 3:26 PM, Robert Paprocki wrote:
>
> Is it necessary to call ngx.req.discard_body() in a access_by_lua filter
> where the content of the request will be served by a proxy_pass directive?
No, never do that.
> If one calls ngx.req.discard_body() in such a context, will the upstream
> receive the request body content?
No, never.
> The documentation says the data on the
> connection is thrown away; does that mean it won't be passed to the
> upstream?
Correct.
>
> Going one step further, should all access_by_lua handlers that could
> potentially receive requests with body content throw the body away if it's
> not needed?
Definitely not.
> The documentation seems to indicate that not calling
> ngx.req.discard_body() is almost universally detrimental.
>
No longer the case in recent versions of ngx_lua. Will you please
contribute a patch to fix that statement in the doc?
Thanks!
-agentzh