mxenabled / mx-platform-ruby

A Ruby library for the MX Platform API
MIT License
2 stars 0 forks source link

Binary Files are not correctly unpacked #90

Open sirwolfgang opened 1 month ago

sirwolfgang commented 1 month ago

I found this working with statements API, but it does effect all file endpoints and as part of the upstream OpenAPI Generator code, effect all file transfers. The header "content-transfer-encoding"=>"binary" is never acknowledged making the files functionally corrupt.

The monkey patch to verify this looks something like this

# Old
@stream.join.force_encoding(encoding)

# Fixed
@stream.join.unpack('m').join.force_encoding(encoding)
sirwolfgang commented 1 month ago

I've opened a PR for the patch here: https://github.com/OpenAPITools/openapi-generator/pull/19132

sirwolfgang commented 1 month ago

Patch has been merged it, will be available as part of 7.8.0

mogman1 commented 1 month ago

Thank you for the report and going the extra mile to submit a patch to the openapi tools generator. We'll keep an eye out for their next release, but we probably won't be able to pick this up for another week or two (and hopefully by then they'll have pushed out that minor version update).