cgi, parse_header and semi-colon

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sylvain

    cgi, parse_header and semi-colon

    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.FieldStorag e.filename returns only "my" everything after the semi-
    colon is missing

    Is it a bug or i'm missing something ?

    Regards
  • Richard Brodie

    #2
    Re: cgi, parse_header and semi-colon


    "Sylvain" <sylvain.vivien @gmail.comwrote in message
    news:b80af57f-897d-4fd1-bebc-df0782143314@25 g2000hsx.google groups.com...
    If we upload a file with a semi-colon (i.e : "C:/my;file.jpg") :
    cgi.FieldStorag e.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.


    Comment

    • Sylvain

      #3
      Re: cgi, parse_header and semi-colon

      On Jun 6, 5:33 pm, "Richard Brodie" <R.Bro...@rl.ac .ukwrote:
      "Sylvain" <sylvain.viv... @gmail.comwrote in message
      >
      news:b80af57f-897d-4fd1-bebc-df0782143314@25 g2000hsx.google groups.com...
      >
      If we upload a file with a semi-colon (i.e : "C:/my;file.jpg") :
      cgi.FieldStorag e.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;fi le.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

      Comment

      • Gabriel Genellina

        #4
        Re: cgi, parse_header and semi-colon

        En Sat, 07 Jun 2008 04:49:41 -0300, Sylvain <sylvain.vivien @gmail.com>
        escribió:
        If we upload a file with a semi-colon (i.e : "C:/my;file.jpg") :
        cgi.FieldStorag e.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

        Comment

        Working...