New submission from Paweł <pawciob...@gmail.com>:

It appears that cgi.FieldStorage does not handle 
Content-Disposition with filenames with defined encoding.
(according to RFC5987)

Example:
'''
Content-Disposition: form-data; name="file"; 
filename*=utf-8''upload_test_file_%C5%82%C3%B3%C4%85%C3%A4.txt
'''

The way to reproduce this is to either try to parse above or
write a tiny webapp using a web framework that uses CGI for handling
file uploads (webpy) and try to upload a file using `requests` - or any library 
that uses urllib3 for building POST with multipart/form-data.

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition

https://tools.ietf.org/html/rfc5987

----------
components: Library (Lib)
messages: 313430
nosy: pawciobiel
priority: normal
severity: normal
status: open
title: handling filename encoding in Content-Disposition by cgi.FieldStorage
type: enhancement
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue33027>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to