Welcome! Log In Create A New Profile

Advanced

Re: 'Content-Length' header for POSTs

agentzh
November 04, 2009 09:04PM
On Wed, Nov 4, 2009 at 12:17 AM, joejacobs <nginx-forum@nginx.us> wrote:
> Let me know if you do end up writing it. I really need to use it
>

I've come up with this (naive) plan to add support for chunked request
body without patching nginx:

location /foo {
echo_read_chunked_request_body;
echo_exec @foo;
}
location @foo {
# your original settings here...no matter proxy_pass, rewrite
or custom handlers
}

The idea is to introduce an "echo_read_chunked_request_body" directive
in my "echo" module to read the client request body *before* other
modules, like "http-proxy", call the
"ngx_http_read_client_request_body" function, and buffer the decoded
request body in r->request_body, to effectively turn
"ngx_http_read_client_request_body" a no-op. And yeah, you'll have to
recompile nginx with the "echo" module anyway.

I'll try a quick implementation by this weekend or possibly the next
week, but no promise :)

I know that a better solution might be implementing it as a
rewrite-phase (or some other earlier phase) handler, but it's a TODO
far-away.

As a side product, it will also give me a basic input filter mechanism
for client request bodies so that I can later implement dynamic
charset conversion input filter, as well as
json/xml/csv/other-data-format decoding filters.

Cheers,
-agentzh
Subject Author Posted

'Content-Length' header for POSTs

joejacobs July 25, 2009 07:41AM

Re: 'Content-Length' header for POSTs

joejacobs July 25, 2009 12:05PM

Re: 'Content-Length' header for POSTs

joejacobs July 27, 2009 10:14PM

Re: 'Content-Length' header for POSTs

Maxim Dounin July 28, 2009 04:30AM

Re: 'Content-Length' header for POSTs

Igor Sysoev July 28, 2009 05:56AM

Re: 'Content-Length' header for POSTs

joejacobs July 28, 2009 06:25AM

Re: 'Content-Length' header for POSTs

Igor Sysoev July 28, 2009 07:22AM

Re: 'Content-Length' header for POSTs

wangkai October 19, 2009 10:59AM

Re: 'Content-Length' header for POSTs

agentzh October 20, 2009 03:06AM

Re: 'Content-Length' header for POSTs

joejacobs November 03, 2009 11:17AM

Re: 'Content-Length' header for POSTs

agentzh November 04, 2009 09:04PM

Re: 'Content-Length' header for POSTs

agentzh November 06, 2009 04:06AM

Re: 'Content-Length' header for POSTs

joejacobs November 08, 2009 06:28PM

Re: 'Content-Length' header for POSTs

agentzh November 13, 2009 06:54AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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