handling defined filename encoding in Content-Disposition #1694
Comments
pawciobiel
pushed a commit
to pawciobiel/cherrypy
that referenced
this issue
Mar 1, 2018
…encoding * Change _cpcompat.unquote_qs to work with unicode on py2 - fix for cherrypy#1694
pawciobiel
added a commit
to pawciobiel/cherrypy
that referenced
this issue
Mar 6, 2018
…encoding * Change _cpcompat.unquote_qs to work with unicode on py2 - fix for cherrypy#1694
pawciobiel
added a commit
to pawciobiel/cherrypy
that referenced
this issue
Mar 13, 2018
…encoding * Change _cpcompat.unquote_qs to work with unicode on py2 - fix for cherrypy#1694
Fixed by #1695 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Do you want to request a feature or report a bug?
I'd like to report a bug because this appears to me as undocumented and undesired behaviour,
but I understand that this could also be feature request.
What is the current behavior?
When POSTing a file containing non ASCII characters in it's name, using Content-Type: multipart/form-data
and Content-Disposition with defined encoding:
form-data; name="myFile"; filename*=utf-8''upload_test_file_%C5%82%C3%B3%C4%85%C3%A4.txt
when accessing upload in POST handler like
myFile.filename
I get file content instead of it's name.
I think that the best way would be to handle encoding and return name as unicode object
but if this isn't possible, perhaps return HTTP 400 Bad Request or at least throw NotImplementedError which would be returned as HTTP 500?
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition
https://tools.ietf.org/html/rfc5987
https://stackoverflow.com/questions/93551/how-to-encode-the-filename-parameter-of-content-disposition-header-in-http
The text was updated successfully, but these errors were encountered: