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
{{ message }}
This repository has been archived by the owner on Apr 5, 2022. It is now read-only.
GET Requests sent by the rest template contain a non-zero content-length header.
This doesn't affect much of the most common webservers, but, as this violates http recommandations, some servers are impacted and can't handle the requests properly.
The presence of a message-body in a request is signaled by the inclusion of a
Content-Length or Transfer-Encoding header field in the request's message-headers. A message-body MUST NOT be included in a request if the specification of the request method (section 5.1.1) does not allow sending an entity-body in requests. A server SHOULD read and forward a message-body on any request; if the request method does not include defined semantics for an entity-body, then the message-body SHOULD be ignored when handling the request.
The text was updated successfully, but these errors were encountered:
Actually, there is nothing in the specification that says GET requests cannot have a body -- see section 9.x.
So it may be inadvisable, but not illegal.
I agree that it is not explicitly forbidden, but Spring Android should embrace the Robustness principle and not rely on the fact that servers, if they are coded in a laxist enough way, may accept its requests.
Hi,
I'm facing the same problem, when I do get request all of them got à Header Content-length equals to 0. And are badly interpreted by server. Does à fix exist for this ?
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
GET Requests sent by the rest template contain a non-zero content-length header.
This doesn't affect much of the most common webservers, but, as this violates http recommandations, some servers are impacted and can't handle the requests properly.
It happens, for instance, but that it not the only one for sure : with mock webserver, a server dedicated for testing http requests inside android or java projects) :
https://code.google.com/p/mockwebserver/issues/detail?id=9&can=1&q=content#makechanges
The specifications of HTTP are clear : (http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html section 4.3 and 4.4)
The text was updated successfully, but these errors were encountered: