Skip to content

When building DELETE requests, the request body is not used in JdkClientHttpRequest.buildRequest #35068

Closed
@lazysasha

Description

@lazysasha

After switching from spring-web:6.2.6 to spring-web:6.2.8 one of the tests in our app stopped working.
After some investigation we found out that TestRestTemplate was not sending a request body when making a DELETE request:

val body = HttpEntity("""["1","2"]""", headers) testRestTemplate.exchange("/v1/messages", HttpMethod.DELETE, body, String::class.java).also { assertEquals(HttpStatus.OK, it.statusCode) }

Digging a bit further, we found out that in spring-web:6.2.8 this logic has been introduced, which eventually creates a DELETE request without a body:

@Override public HttpRequest.Builder DELETE() { return method0("DELETE", null); }

Could someone have a look at it please?

Let me know if you need more information.

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: regressionA bug that is also a regression

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions