Skip to content
This repository was archived by the owner on Apr 5, 2022. It is now read-only.
This repository was archived by the owner on Apr 5, 2022. It is now read-only.

GET request have a non-zero content length #11

@stephanenicolas

Description

@stephanenicolas

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 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions