Skip to content

Not respecting quotes in headers #1397

Description

Originally reported by: Shy Pike (Bitbucket: shypike, GitHub: @shypike


When a header contains a value between quotes and that value contains a semicolon
";", the header will not be parsed properly.

Example from a "Content-Disposition" header:

#!text

form-data; name="name"; filename="one;word.txt"

The cause is cherrypy/lib/httputil.py, line 148, function parse().

#!python

atoms = [x.strip() for x in elementstr.split(";") if x.strip()]

That code is too simple, it splits in the middle of the file name.


Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions