tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adrian Sampaleanu" <>
Subject Bug(?) and suggested solution for chunked transfer-encoding POST request
Date Fri, 08 Nov 2002 16:54:07 GMT

We are having a problem with Catalina 4.1.12 (I believe we also had issues with previous versions,
but can't say for sure) with respect to how POSTed requests are handled if the transfer encoding
is "chunked". It seems that request parameters in the content are not processed in this case.

Looking at the source, in the method parseParameters() does the following

if ("POST".equals(getMethod()) && (getContentLength() > 0)
    && ( == null)
    && "application/x-www-form-urlencoded".equals(contentType)) {

   Processing of params in the content

The problem is that with chunked transfer encoding the content length condition isn't met
since parseHeaders() in only sets this if the content-length header exists
which is not the case with chunked transfers. It would seem that the check in
shoud really be:

String transferEncoding = request.getHeader("Transfer-Encoding");
boolean chunked = ((transferEncoding != null) && (transferEncoding.indexOf("chunked")
!= -1));

if ("POST".equals(getMethod()) && (getContentLength() > 0 || chunked)
    && ( == null)
    && "application/x-www-form-urlencoded".equals(contentType))

If I'm way off base, does anyone have the real solution?

Adrian Sampaleanu
Activience Inc.


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message