|
Home > Archive > Apache Mod-Python > April 2006 > FieldStorage and multiline headers in multipart/form.
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
FieldStorage and multiline headers in multipart/form.
|
|
| Graham Dumpleton 2006-04-08, 7:06 pm |
| With FieldStorage being discussed on main user mailing list, came across
this old post of the mailing list:
http://www.modpython.org/pipermail/...ber/012256.html
What it is saying is that some HTTP clients use multi line headers in sections
of multipart/form postings and that mod_python doesn't handle this.
Looking at FieldStorage code, which I don't grok right at this minute
because of an intensive coding frenzy today on the back of not enough
sleep last night, I can't see that it has ever been modified to accomodate
such multiline headers if indeed it needs to.
Anyone who is more intimate with FieldStorage code want to have a
better look at validity of original mailing list post and whether multiline
headers are legitimate and whether there indeed could be a problem in
mod_python.
Graham
| |
| Jim Gallacher 2006-04-08, 7:06 pm |
| I'll take a look at the code tonight.
Jim
Graham Dumpleton wrote:
> With FieldStorage being discussed on main user mailing list, came across
> this old post of the mailing list:
>
> http://www.modpython.org/pipermail/...ber/012256.html
>
> What it is saying is that some HTTP clients use multi line headers in sections
> of multipart/form postings and that mod_python doesn't handle this.
>
> Looking at FieldStorage code, which I don't grok right at this minute
> because of an intensive coding frenzy today on the back of not enough
> sleep last night, I can't see that it has ever been modified to accomodate
> such multiline headers if indeed it needs to.
>
> Anyone who is more intimate with FieldStorage code want to have a
> better look at validity of original mailing list post and whether multiline
> headers are legitimate and whether there indeed could be a problem in
> mod_python.
>
> Graham
>
| |
| Mike Looijmans 2006-04-11, 8:01 am |
| Short answer: Yes, multiline headers are allowed there, and yes,
mod_python will fail to read them properly.
Longer answer:
I checked throught the util.py code, and nope, the fix is not in there.
I browsed through the appropriate RFC documents, in particular RFC1521
http://www.faqs.org/rfcs/rfc1521.html
This clearly states that RFC822 headers are to be used, which means that
those multiline headers are indeed allowed. The 1521 document even
contains samples with multiline headers.
Just a thought: Can we (re)use the rfc822 mime parser that's already
built-in in Python to do the work for us?
--
Mike Looijmans
Philips Natlab / Topic Automation
Graham Dumpleton wrote:
> With FieldStorage being discussed on main user mailing list, came across
> this old post of the mailing list:
>
> http://www.modpython.org/pipermail/...ber/012256.html
>
> What it is saying is that some HTTP clients use multi line headers in sections
> of multipart/form postings and that mod_python doesn't handle this.
>
> Looking at FieldStorage code, which I don't grok right at this minute
> because of an intensive coding frenzy today on the back of not enough
> sleep last night, I can't see that it has ever been modified to accomodate
> such multiline headers if indeed it needs to.
>
> Anyone who is more intimate with FieldStorage code want to have a
> better look at validity of original mailing list post and whether multiline
> headers are legitimate and whether there indeed could be a problem in
> mod_python.
>
> Graham
| |
|
| Mike Looijmans wrote:
> Just a thought: Can we (re)use the rfc822 mime parser that's already
> built-in in Python to do the work for us?
I believe the standard cgi module does just that. I'm probably going to
hell for having been importing cgi and replacing parse_qs[l] with the
versions from _apache.
Nick
|
|
|
|
|