-
Notifications
You must be signed in to change notification settings - Fork 9.2k
OkHttpClient throws illegalStateException when sever sends 100-continue responses prior to the actual response #8739
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
Comments
Is this likely fixed by #8569 ? |
tested using the latest master, and it appears issue is still present |
IllegalStateException is definitely wrong. But I'm not sure OkHttp should ignore multiple 100 responses. It seems like a badly behaved server. https://stackoverflow.com/questions/22818059/several-100-continue-received-from-the-server Would an IOException be appropriate? |
I think that spec might be outdated.. The only requirement on the server side is " A server that sends a 100 (Continue) response MUST ultimately send a final status code, once it receives and processes the request content, unless the connection is closed prematurely." |
The 4.x branch still needs a fix. Attempting on #8763 but still failing one case |
Did a quick manual test on the latest master branch with your commit, issue appears to be fixed .. thanks. Will it be backported to 4.x branch. |
Yes, but will need some more work on that CL |
OKHttpClient (4.12.0) crashes with illegalStateException when the server sends a 100-Continue response before the actual response; this bug is similar to #3628;
Details of this issue are specified in https://stackoverflow.com/questions/79567656/okhttpclient-throws-illegalstateexception-when-server-responds-with-100-continue
Tested it on three different clients using the same server , all of them handles 100-continue responses from server when the clients are not expecting 100-continue response (i.e when expect 100-continue is not specified in the header , the client would just ignore the 100-continue response from server and wait for actual response ).
Expected behaviour would be, OkHttpClient to gracefully handle a 100-continue response from a server without crashing.
The text was updated successfully, but these errors were encountered: