Files
spring-integration/spring-integration-http/src
Artem Bilan 31090da79a GH-9489: Remove Content-Length HTTP before sending GET request
Fixes: #9489
Issue link: https://github.com/spring-projects/spring-integration/issues/9489

If request message has a `Content-Length` HTTP, it is still mapped to the target HTTP request
even if that one is indicated as "no-body" (`GET`, `HEAD`, `TRACE`).
In this case Netty fails to decode such a missed body with error:
```
java.lang.IllegalArgumentException: text is empty (possibly HTTP/0.9)), version: HTTP/1.0
```

* Since `Content-Length` is not supposed to be supported for those methods,
remove it altogether from the HTTP request headers
* Add nullability API into the `org.springframework.integration.http.outbound`
* Check received HTTP request on the server side that it does not have such a header for `GET`

(cherry picked from commit 891dca7179)
2024-09-18 17:50:10 +00:00
..