[mod_python] Strange HTTP Response

Jim Gallacher jg.lists at sympatico.ca
Thu Sep 29 15:19:10 EDT 2005


Iwasso 80s wrote:
> We aren't using the publisher handler.  However, we are returning
> apache.OK as a response to the handler call.  Should we be returning
> something else?
> 
> Also, I captured a "good" response.  And I noticed it does contain
> more data than purely the header and html body of the document.
> 
> START OF DOCUMENT:
> ---------------------------------------------------------------------------------------------------------------------
> HTTP/1.1 200 OK
> Date: Thu, 29 Sep 2005 16:07:44 GMT
> Server: Apache/2.0.54 (Debian GNU/Linux)
> Pragma: no-cache
> Cache-Control: no-cache
> Expires: -1
> Keep-Alive: timeout=7, max=29
> Connection: Keep-Alive
> Transfer-Encoding: chunked
> Content-Type: text/html
> 
> 1
> 
> 144d
> 
> 	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> <html xmlns="http://www.w3.org/1999/xhtml">
> ---------------------------------------------------------------------------------------------------------------------
> 
> 
> END OF DOCUMENT:
> ---------------------------------------------------------------------------------------------------------------------
> </html>
> 
> 
> 1
> 
> 0
> ---------------------------------------------------------------------------------------------------------------------
> 
> What do you guys think?  Is this normal behavior?

Yes. I suggest you goggle chunked transfer-encoding. Starting after the 
headers you interpret the chunk sizes in hex as:
1 = 1 character
144d = 5197 characters
1 = 1 characters
0 = 0 characters (ie no more chunks)

Browsers use the chunk sizes to re-assemble the complete document.
Jim


More information about the Mod_python mailing list