python / cpython

The Python programming language
https://www.python.org
Other
62.46k stars 29.98k forks source link

cgi.py does not correctly handle fields with ';' #41090

Closed 1aacda76-7c51-4205-abac-b9e80312b0a4 closed 15 years ago

1aacda76-7c51-4205-abac-b9e80312b0a4 commented 19 years ago
BPO 1055234
Nosy @freddrake
Files
  • cgi.patch: Patch to cgi.py
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields: ```python assignee = 'https://github.com/freddrake' closed_at = created_at = labels = ['library'] title = "cgi.py does not correctly handle fields with ';'" updated_at = user = 'https://bugs.python.org/kv11111' ``` bugs.python.org fields: ```python activity = actor = 'fdrake' assignee = 'fdrake' closed = True closed_date = closer = 'fdrake' components = ['Library (Lib)'] creation = creator = 'kv11111' dependencies = [] files = ['6330'] hgrepos = [] issue_num = 1055234 keywords = ['patch'] message_count = 3.0 messages = ['47175', '47176', '76921'] nosy_count = 2.0 nosy_names = ['fdrake', 'kv11111'] pr_nums = [] priority = 'normal' resolution = 'fixed' stage = 'resolved' status = 'closed' superseder = None type = None url = 'https://bugs.python.org/issue1055234' versions = ['Python 2.3'] ```

    1aacda76-7c51-4205-abac-b9e80312b0a4 commented 19 years ago

    When I'm trying to upload file named 'a;b' cgi.py says that it is named '"a'. Simple patch to fix it attached. P.S. The same bug are present in mimetools.py and may be in other same places.

    freddrake commented 19 years ago

    Logged In: YES user_id=3066

    The Content-Disposition header is defined in RFC 2183:

    http://www.faqs.org/rfcs/rfc2183.html

    freddrake commented 15 years ago

    This is now fixed for Python 2.6.?, 2.7, 3.0.1, and 3.1.

    I've no idea why I didn't write a test for this sooner.