FieldStorage and multiline headers in multipart/form.
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Apache Server configuration support > Apache Mod-Python > FieldStorage and multiline headers in multipart/form.




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    FieldStorage and multiline headers in multipart/form.  
Graham Dumpleton


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-09-06 12:06 AM

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 sectio
ns
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






[ Post a follow-up to this message ]



    Re: FieldStorage and multiline headers in multipart/form.  
Jim Gallacher


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-09-06 12:06 AM

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 sect
ions
> 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 multilin
e
> headers are legitimate and whether there indeed could be a problem in
> mod_python.
>
> Graham
>







[ Post a follow-up to this message ]



    Re: FieldStorage and multiline headers in multipart/form.  
Mike Looijmans


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-11-06 01:01 PM

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 sect
ions
> 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 multilin
e
> headers are legitimate and whether there indeed could be a problem in
> mod_python.
>
> Graham







[ Post a follow-up to this message ]



    Re: FieldStorage and multiline headers in multipart/form.  
Nick


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-18-06 05:06 AM

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






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 09:35 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register