After upgrading our java services to the latest Spring Boot version (3.4.1), we encountered an issue with the DELETE API.

When a request from the gateway service (v3.4.1) is routed to a Node.js service (v22.12.0), the Content-Length header is missing from the request headers for DELETE APIs.

This header is present in the previous Spring Boot version (v3.3.5) that we were using. Although the DELETE API does not have a request payload, the Node.js service enforces a check for the Content-Length header, expecting it to be explicitly set to 0. This check is implicitly enforced by the Fastify library used in the Node.js repository.

There is no information provided on the spring-boot release notes.

Therefore, we have been unable to determine the cause of this change in the request headers and have reverted to the previous Spring Boot version (v3.3.5), which functions correctly.

ERROR LOGS :

err{
    code | FST_ERR_CTP_INVALID_MEDIA_TYPE
    message | Unsupported Media Type: undefined
    name | FastifyError
    stack | FastifyError: Unsupported Media Type: undefined     at ContentTypeParser.run 
    (/home/node/node_modules/fastify/lib/contentTypeParser.js:180:18)     at Object.handleRequest 
    (/home/node/node_modules/fastify/lib/handleRequest.js:46:35)     at runPreParsing (/home/node/node_modules/fastify/lib/route.js:571:19)     
    at next (/home/node/node_modules/fastify/lib/hooks.js:233:9)     at handleResolve (/home/node/node_modules/fastify/lib/hooks.js:250:7)
    statusCode | 415
    type | FastifyError
}

Comment From: bclozel

Sorry but this report isn't actionable on our side.

a request from the gateway service (v3.4.1)

Are you using Spring Cloud Gateway, or a custom application?

Can you share a minimal sample showing the problem? No need for several services, a simple gateway + using httpbin should be enough.

Also, this error doesn't seem to point to the "Content-Length" header but rather to a missing "Content-Type" header. In the case of a DELETE method, there shouldn't be any.