Add a default MIME type when encoding file-like objects

Issue #5 new
Chris Adams
created an issue

I have an application which needs to encode file-like objects (StringIO / urlopen) containing data from another webserver which I'm dumping into Solr. I ran into an odd behaviour due to the way the mimetype is guessed:

https://bitbucket.org/chrisatlee/poster/src/9d7c9510afe8/poster/encode.py#cl-174

With StringIO, if I don't add a name property the file contents will be encoded as a long string rather than a separate mime part. What do you think about changing the to default to {{{application/octet-stream}}} so file-like values will always be encoded as mime parts?

Comments (1)

  1. Log in to comment