By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,001 Members | 1,176 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,001 IT Pros & Developers. It's quick & easy.

cgi, parse_header and semi-colon

P: n/a
Hi,

I'm playing with Google App Engine and during my tests it seems that
there is a bug in cgi. parse_header function.

If we upload a file with a semi-colon (i.e : "C:/my;file.jpg") :
cgi.FieldStorage.filename returns only "my" everything after the semi-
colon is missing

Is it a bug or i'm missing something ?

Regards
Jun 27 '08 #1
Share this Question
Share on Google+
3 Replies


P: n/a

"Sylvain" <sy************@gmail.comwrote in message
news:b8**********************************@25g2000h sx.googlegroups.com...
If we upload a file with a semi-colon (i.e : "C:/my;file.jpg") :
cgi.FieldStorage.filename returns only "my" everything after the semi-
colon is missing

Is it a bug or i'm missing something ?
I doubt it's bug in parse_header, since it's meant to split on
semicolons. Whether it's a bug in one of its callers, or the client
not escaping sufficiently, I couldn't say offhand.
Jun 27 '08 #2

P: n/a
On Jun 6, 5:33 pm, "Richard Brodie" <R.Bro...@rl.ac.ukwrote:
"Sylvain" <sylvain.viv...@gmail.comwrote in message

news:b8**********************************@25g2000h sx.googlegroups.com...
If we upload a file with a semi-colon (i.e : "C:/my;file.jpg") :
cgi.FieldStorage.filename returns only "my" everything after the semi-
colon is missing
Is it a bug or i'm missing something ?

I doubt it's bug inparse_header, since it's meant to split on
semicolons. Whether it's a bug in one of its callers, or the client
not escaping sufficiently, I couldn't say offhand.
I've printed the filename in the content-disposition header :
filename="my;file.jpg"

If you look at the http://www.ietf.org/rfc/rfc2183.txt about "content-
disposition" :

"A short parameter value containing only ASCII characters, but
including `tspecials' characters, SHOULD be represented as `quoted-
string'."

So my header is correct but i think there is clearly a bug in the
parse_header and "content-disposition" should not be "splitted" only
with the split(';') method but should look at quoted-string too.

Regards
Jun 27 '08 #3

P: n/a
En Sat, 07 Jun 2008 04:49:41 -0300, Sylvain <sy************@gmail.com>
escribió:
If we upload a file with a semi-colon (i.e : "C:/my;file.jpg") :
cgi.FieldStorage.filename returns only "my" everything after the semi-
colon is missing
It's a known bug: http://bugs.python.org/issue1540529 - the patch is
waiting for review...

--
Gabriel Genellina

Jun 27 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.