-
-
Notifications
You must be signed in to change notification settings - Fork 321
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
[Bug] Android: malformed empty multipart requests #372
Comments
Hi Silvio, I've checked how an empty FormData instance is handled in AFNEtworking (on iOS). It's just falling back to an empty url encoded request instead, which seemed strange at first sight. But on the other hand: it never caused problems as yet and sending empty multipart requests should be an extremely rare case. So I've decided to match this behavior on Android. This issue will be fixed in 3.1.1. 🤗 |
Great! Thanks for fixing this. An empty urlencoded request will still be
parsed cleanly. So while strange, it's better than a loud error on certain
frameworks.
Thanks again.
…On Sun, Oct 18, 2020 at 10:40 PM Sefa Ilkimen ***@***.***> wrote:
Hi Silvio, I've checked how an empty FormData instance is handled in
AFNEtworking (on iOS). It's just falling back to an empty url encoded
request instead, which seemed strange at first sight. But on the other
hand: it never caused problems as yet and sending empty multipart requests
should be an extremely rare case. So I've decided to match this behavior on
Android. This issue will be fixed in 3.1.1. 🤗
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#372 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAWVGEA7ZUGEAXZIZBGR4LSLORIRANCNFSM4SBDDGVQ>
.
|
Hello @silkimen, can you please tag the 3.1.1 for release? |
Describe the bug
First of all: thanks for all your work on this library. It's a life saver with cookies and avoiding CORS.
On Android only, if you post multipart with an empty FormData object, the boundary is not set. This is invalid and some frameworks will refuses to parse the request. See here: https://stackoverflow.com/questions/34326150/multipartparsererror-invalid-boundary
Note: only happens on Android, not on iOS. I don't know much Android native dev, but I added a few breakpoints and
startPart
in HttpRequest.java is not called for empty requests. So the boundary is missing. See screenshots.System info
Minimum viable code to reproduce
Using ionic's wrapper:
Screenshots
With data:
Without data (bug):
The text was updated successfully, but these errors were encountered: