Subject: | [WISH] support Content-Transfer-Encoding in multipart |
Generally, this module works great for me in conjunction with Catalyst.
However, when multipart uploading a binary file via
Test::WWW::Mechanize::Catalyst, the parser gets confused (after much
delving, I still can't quite figure out why but I suspect UTF-8 vs.
bytes) and gets stuck at $self->{part}->{done} == 0 after over-reading
the end of the part.
So, my workaround is to MIME::Base64::encode() the upload and set a
header of "Content-Transfer-Encoding: base64". This helps, and the
parser successfully completes the part and Catalyst registers it as a
Catalyst::Request::Upload instance. Great! However,
HTTP::Body::MultiPart doesn't pay any attention to the transfer
encoding, so it fails to decode the content and my app gets the content
still Base64 encoded.
Maybe HTTP::Body::MultiPart should leverage an existing MIME parser and
get all of the wonderful features therein? Alternatively maybe I should
ask the Catalyst folks to add decoding to their upload handling code?
Or maybe the bug is just somewhere in the Test::WWW::Mechanize workflow?
In the meantime, I'm think I'm going to add a check in my app for the
transfer encoding and manually decode it.