-
Notifications
You must be signed in to change notification settings - Fork 432
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
Fix content length parameter for InlineDataPart #653
Conversation
Codecov Report
@@ Coverage Diff @@
## master #653 +/- ##
=========================================
Coverage 71.07% 71.07%
Complexity 297 297
=========================================
Files 57 57
Lines 1490 1490
Branches 193 193
=========================================
Hits 1059 1059
Misses 339 339
Partials 92 92
Continue to review full report at Codecov.
|
Does this take in account the target encoding? (Thank you for working on this ❤️) |
@SleeplessByte Its a good question, I updated code so now it takes in account encoding |
It would be great if you could add one test case that shows this (have it have emojis and test the length, the old code should be incorrect and the new code should be correct). Would you be able to do that? |
Description
Hi Fuel team, right now we are using your library as main networking tool and we have several multipart data request for uploading images.
What I have found, that in your InlineDataPart you are using
content.length.toLong()
which is not right. For example, you can have emoji in your content and measuing size of the DataPart by string length doesn't seem proper.So instead I changed measuring size of the InlineDataPart to
content.toByteArray().size
I didn't find a issue related to this problem and created pull request right away. I hope you will find and useful and merge into the master, because its really crucial for us.
Type of change
Check all that apply
How Has This Been Tested?
Tested it with several strings with emoji.
Checklist: