-
-
Notifications
You must be signed in to change notification settings - Fork 26
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
Multipart body altering #7
Comments
Hi! |
Is this a real file size? Filename with ".jpg" or ".jpeg" extension here
Only headers of file part |
@itkacher thank you for such a quick response.
Output:
And looses intercepted parts' content.
Yep, that is intended. |
Failed request with original interceptor: |
Thanks a lot. I will try to fix soon. Sorry about the issue. |
Request header is: |
I did some request fixes with encoding, not sure that this is it.
Because a server needs to know the boundary for correct request parsing. |
I agree that it's not too healthy to provide wrong Content-Type here but our server consumes it for now, will work on it further anyway, but I'm not too sure that it may cause this particular problem because request is delivered with no issues using series of other custom and opensource interceptors for different purposes. Nevertheless, will fix it ASAP, thank you. Going to test new version out and notify about the results! |
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type
This header is important for the multipart form data. |
Thank you for clarifying. I managed to fix headers and some internal stream feeding flow, here are some interesting points:
REST service upload method signature:
Request preparing & uploading flow:
Now that's still firing ok with no OkHttpProfiler interceptor and fails with it getting new unexpected end of stream. New output: And one more interesting observation. In case we're creating prepared RequestBody with byte array:
It fires ok with or without interceptor: |
I'm comparing successful and failed request bodies side-by-side and getting small diffs present... |
@DummyCo can you remove a reference from this issue square/okhttp#3585 ?
I will test 'CountingRequestBody' and define the problem |
Sure, just wanted to provide author implementations, but I'm afraid reference is set automatically by GitHub and can't be undone 😥 |
Hi there! Thank you for that nice interceptor.
We've faced fancy issue here:
While trying to upload multipart body containing file with OkHttpProfiler connected, our backend notifies body validation error. With no OkHttpProfiler connected everything fires just ok.
During further inspection we're getting next raw body starting:
I'm not sure about validity of that boundary appendix and produced Content-Length.
Is it somehow altered by OkHttpProfiler? Thank you!
The text was updated successfully, but these errors were encountered: