-
Notifications
You must be signed in to change notification settings - Fork 131
Added support for string-content attachments & fixed HTTParty encoding issues. #530
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Pull Request SummaryThe pull request introduces several enhancements and fixes to improve file handling, error management, and multipart upload functionality in the Nylas Ruby SDK. Key changes include:
These changes aim to enhance the SDK's reliability, compatibility, and user experience when dealing with file uploads and multipart requests, particularly focusing on error management and internationalization support. Functional Tests
Files Changed
View more in PlayerZero |
- Replace Tempfile with StringIO in prepare_multipart_payload to eliminate filesystem dependencies - Add enhanced StringIO compatibility methods for HTTParty multipart handling - Update test expectations from Tempfile to StringIO - Add defensive file closing in messages.rb - Resolves issues with read-only containers and AWS Lambda environments Fixes #528
…multipart requests Fixes #528 - Resolves 'incompatible character encodings: ASCII-8BIT and UTF-8' error when sending multipart requests - Normalizes all multipart payload strings to consistent ASCII-8BIT encoding for HTTParty compatibility - Maintains backward compatibility while preventing encoding conflicts during multipart body generation - Updates test expectations to reflect new encoding behavior
…lization - Add normalize_json_encodings! method to handle binary attachment content - Automatically base64 encode binary strings before JSON serialization - Fixes 'source sequence is illegal/malformed utf-8' error when sending attachments with raw binary content via JSON (non-multipart) requests - Preserves backward compatibility with both symbol and string keys - Resolves issue #528
ajay-k
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Description
Reported in issue #528 - see a similar issue reported here jnunemaker/httparty#671
Fixes: Encoding::CompatibilityError when sending multipart requests with UTF-8 content
Closes: #528
https://nylas.atlassian.net/browse/TW-3983
License
I confirm that this contribution is made under the terms of the MIT license and that I have the authority necessary to make this contribution on behalf of its copyright owner.