[New-bugs-announce] [issue25072] CGI large POST data string truncated

Vincent Caloone report at bugs.python.org
Fri Sep 11 19:57:28 CEST 2015


New submission from Vincent Caloone:

For "large" POST request (> 25 ko), cgi.FieldStorage() doesn't contains all field in the html form. When we trace the root of the issue, it is located in file server.py : 

if self.command.lower() == "post" and nbytes > 0:
    data = self.rfile.read(nbytes)

the size of 'rfile' is less than the number of byte we attemp to read 'nbyte' with is corresponding to the Content-Length of the POST request header.

Issue seems to be linked with buffering since changing rbufsize from 0 to -1 : 

    # Make rfile unbuffered -- we need to read one line and then pass
    # the rest to a subprocess, so we can't use buffered input.
    #rbufsize = 0
    rbufsize = -1 

stop the issue. Any idea of the real root of this issue ?

Many thanks.

----------
messages: 250479
nosy: Vincent Caloone
priority: normal
severity: normal
status: open
title: CGI large POST data string truncated
type: behavior
versions: Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue25072>
_______________________________________


More information about the New-bugs-announce mailing list