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
GH-9489: Remove Content-Length HTTP before sending GET request
Fixes: #9489
Issue link: #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 891dca7)
Copy file name to clipboardExpand all lines: spring-integration-http/src/main/java/org/springframework/integration/http/outbound/AbstractHttpRequestExecutingMessageHandler.java
+8-7Lines changed: 8 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
/*
2
-
* Copyright 2017-2023 the original author or authors.
2
+
* Copyright 2017-2024 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
Copy file name to clipboardExpand all lines: spring-integration-http/src/main/java/org/springframework/integration/http/outbound/HttpRequestExecutingMessageHandler.java
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
/*
2
-
* Copyright 2002-2021 the original author or authors.
2
+
* Copyright 2002-2024 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -97,7 +97,7 @@ public HttpRequestExecutingMessageHandler(Expression uriExpression) {
Copy file name to clipboardExpand all lines: spring-integration-webflux/src/test/java/org/springframework/integration/webflux/outbound/WebFluxRequestExecutingMessageHandlerTests.java
0 commit comments