Commit 4040ad7
authored
Added support for string-content attachments & fixed HTTParty encoding issues. (#530)
* fix(http-client): replace Tempfile with StringIO for multipart uploads
- 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
* fix(http-client): resolve HTTParty encoding compatibility issue with 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
* Fix UTF-8 encoding issue with binary attachment content in JSON serialization
- 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 #5281 parent c35e81e commit 4040ad7
File tree
8 files changed
+893
-89
lines changed- examples/messages
- lib/nylas
- handler
- resources
- spec/nylas
- handler
- utils
8 files changed
+893
-89
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
5 | 8 | | |
6 | 9 | | |
7 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
6 | 8 | | |
7 | 9 | | |
8 | 10 | | |
| |||
0 commit comments