You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mod_python-dev@quetz.apache.org by "Graham Dumpleton (JIRA)" <ji...@apache.org> on 2006/09/11 13:59:22 UTC

[jira] Commented: (MODPYTHON-159) multiline headers in multipart/form not handled

    [ http://issues.apache.org/jira/browse/MODPYTHON-159?page=comments#action_12433832 ] 
            
Graham Dumpleton commented on MODPYTHON-159:
--------------------------------------------

Does this patch seem correct for current implementation of util.FieldStorage?

Index: lib/python/mod_python/util.py
===================================================================
--- lib/python/mod_python/util.py       (revision 442143)
+++ lib/python/mod_python/util.py       (working copy)
@@ -174,6 +174,10 @@
   
             skip_this_part = False
             while line not in ('\r','\r\n'):
+                nextline = req.readline(readBlockSize)
+                while nextline and nextline[0] in [ ' ', '\t']:
+                    line = line + nextline
+                    nextline = req.readline(readBlockSize)
                 # we read the headers until we reach an empty line
                 # NOTE : a single \n would mean the entity is malformed, but
                 # we're tolerating it anyway
@@ -192,7 +196,7 @@
                     if ctype.find('/') == -1:
                         ctype = 'application/octet-stream'
             
-                line = req.readline(readBlockSize)
+                line = nextline
                 match = boundary.match(line)
                 if (not line) or match:
                     # we stop if we reached the end of the stream or a stop boundary


> multiline headers in multipart/form not handled
> -----------------------------------------------
>
>                 Key: MODPYTHON-159
>                 URL: http://issues.apache.org/jira/browse/MODPYTHON-159
>             Project: mod_python
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 3.2.8, 3.1.4
>            Reporter: Graham Dumpleton
>             Fix For: 3.3
>
>
> Reported a long time back on mailing list that multiline headers in a multipart/form post are not handled properly by util.FieldStorage class.
>   http://www.modpython.org/pipermail/mod_python/2001-November/012256.html
> This seems to never have been addressed. Further comments confirming this posted in:
>   http://www.mail-archive.com/python-dev@httpd.apache.org/msg01805.html

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira