Welcome! Log In Create A New Profile

Advanced

Content-Length is not ignored for chunked requests: Nginx violates RFC 2616

agentzh
December 17, 2009 09:54PM
Hi,

I've noticed this issue while fixing bugs for my ngx_chunkin module,
reported by J.

Yeah, nginx explicitly checks the "chunked" transfer-encoding header
and throws out a 411 Length Required exception as early as in the
ngx_http_process_request_header function. Well, trouble is,
ngx_http_finalize_request calls ngx_http_discard_request_body, which
eagerly reads and discards the request body according to a non-zero
Content-Length header in the request. But according to RFC 2616,
ngx_http_discard_request_body should really do NOTHING in this
scenario:

If a message is received with both a
Transfer-Encoding header field and a Content-Length header field
the latter MUST be ignored.
-- RFC 2616 section 4.4

I can't easily work around this for my ngx_chunkin module because this
action is called just too early, even before ngx_http_process_request
gets called. Oh, well...and my users and I will have a BAD time if
I'll have to patch the core myself.

Lots of phones send chunked requests with an explicit Content-Length
header according to J's report. We're already reaching to the point to
support most phones completely by means of ngx_chunkin but
unfortunately hit this potentially last obstacle ;)

I'd really hope to see this issue gets fixed in the mainstream version
of nginx AND get a work-around for existing versions >= 0.7.21 ;)

Any help will be highly appreciated :)

Thanks!
-agentzh

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

Content-Length is not ignored for chunked requests: Nginx violates RFC 2616

agentzh 3472 December 17, 2009 09:54PM

Re: Content-Length is not ignored for chunked requests: Nginx violates RFC 2616

agentzh 1245 December 18, 2009 02:06AM



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

Online Users

Guests: 82
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready