arskom / spyne

A transport agnostic sync/async RPC library that focuses on exposing services with a well-defined API using popular protocols.
http://spyne.io
Other
1.13k stars 313 forks source link

Encoding issue on multipart related binary content #603

Closed ghost closed 5 years ago

ghost commented 5 years ago

Hi, i discover an error on multipart xml content if attached binary zip xml file include extra base64 content getting zip file damaged

like photo this xml file from damaged zip ( can extract only part of begin and until image)

error_file

if zip xml e doenst include similar content saving without any problem.

i have tested similar request with @http.route and when i try decode with (ascii, or UTF-8 ) show me cant decode part error when i try decode with (iso-8859-1 or latin-1) decoded successfuly and attached binary object saved without error.

plq commented 5 years ago

This doesn't give me much to work with. Please provide a self-contained example, very much like https://github.com/plq/spyne/tree/master/examples/xml/soap12-mtom complete with server code and payload to simulate and I can have a look.

ghost commented 5 years ago

an note in the txt : GIB file decoded with iso-8859-1 and base64: only file part of saved file , file_body is only decoded(iso-8859-1) part of binary

with open(file_name, "wb") as code: code.write(file_body.encode("iso-8859-1"))

plq commented 5 years ago

The attached files are fine. I don't see any problem. The FD9FB8D0-A5C6-4EAB-B229-77C6DDE39C5A.zip file decompresses successfully

plq commented 5 years ago
$ unzip -t FD9FB8D0-A5C6-4EAB-B229-77C6DDE39C5A.zip 
Archive:  FD9FB8D0-A5C6-4EAB-B229-77C6DDE39C5A.zip
    testing: FD9FB8D0-A5C6-4EAB-B229-77C6DDE39C5A.xml   OK
No errors detected in compressed data of FD9FB8D0-A5C6-4EAB-B229-77C6DDE39C5A.zip.
ghost commented 5 years ago

Yes i save file with http route method. File getting healty, also txt file contain raw data. I attached file and body responses coz i cant sent with curl.

ghost commented 5 years ago

I cant sent this file or requested data with curl, i attached responses , i dont know how, if u can send you will see zip will gone corrupt

plq commented 5 years ago

I cant sent this file or requested data with curl, i attached responses , i dont know how

Now is a good time to learn then!.

Reopen when you have something to show me.

ghost commented 5 years ago

Also i fix my problem with manual decoding, problem is no more my problem, its spyne’s problem after then, as you wish fix or not. Have nice works, spyne is great job