ok. I just tested that part-handler are now getting "raw" payload if they encoded with base64 and set the content type encoding to 'base64'.
I tested just now like this:
$ write-mime-multipart --gzip -o out.gz part-handler /bin/true:application/octet-stream /etc/passwd:text/plain /bin/sleep:application/octet-stream
where part-handler has:
#part-handler
import base64
def list_types():
return(["application/octet-stream"])
def handle_part(data,ctype,filename,payload):
if ctype == "__end__" or ctype == "__begin__": return
if ctype == "application/octet-stream":
stream = "%s/%s" % ('/tmp/',filename)
f = open(stream, 'wb') f.write(payload)
f.close()
The result is that there are /tmp/sleep and /tmp/true with content as they should have.
So, to be clear, this will break part-handlers that were expecting the base64 double encoding.
ok. I just tested that part-handler are now getting "raw" payload if they encoded with base64 and set the content type encoding to 'base64'.
I tested just now like this: multipart --gzip -o out.gz part-handler /bin/true: application/ octet-stream /etc/passwd: text/plain /bin/sleep: application/ octet-stream
$ write-mime-
where part-handler has:
#part-handler ["application/ octet-stream" ]) part(data, ctype,filename, payload) : octet-stream" :
f.write( payload)
import base64
def list_types():
return(
def handle_
if ctype == "__end__" or ctype == "__begin__": return
if ctype == "application/
stream = "%s/%s" % ('/tmp/',filename)
f = open(stream, 'wb')
f.close()
The result is that there are /tmp/sleep and /tmp/true with content as they should have.
So, to be clear, this will break part-handlers that were expecting the base64 double encoding.