You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was trying to use the Expect header while uploading data. I noticed that Jersey client sends the same request twice when server returns back with a non-100 response. Debugging further into this revealed that HTTPURLConnection throws ProtocolException with "Server rejected operation" message and does not read the full response body or store the headers. HttpUrlConnector._apply method tries to set the headers to ClientResponse using HTTPURLConnection.getHeaderFields. getHeaderFields method first tries to getInputStream which in turn call getOutputStream. This results in sending the request again since both streams are null due the the ProtocolException.
I was trying to use the Expect header while uploading data. I noticed that Jersey client sends the same request twice when server returns back with a non-100 response. Debugging further into this revealed that HTTPURLConnection throws ProtocolException with "Server rejected operation" message and does not read the full response body or store the headers. HttpUrlConnector._apply method tries to set the headers to ClientResponse using HTTPURLConnection.getHeaderFields. getHeaderFields method first tries to getInputStream which in turn call getOutputStream. This results in sending the request again since both streams are null due the the ProtocolException.
I have a PR: #4588 which will solve this issue.
The text was updated successfully, but these errors were encountered: