Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

content-length header is missing on delete api after upgrading java services to spring boot version : 3.4.1 #43935

Open
Nivrity opened this issue Jan 23, 2025 · 1 comment
Labels
status: waiting-for-feedback We need additional information before we can continue status: waiting-for-triage An issue we've not yet triaged

Comments

@Nivrity
Copy link

Nivrity commented Jan 23, 2025

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
}
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jan 23, 2025
@bclozel
Copy link
Member

bclozel commented Jan 23, 2025

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.

@bclozel bclozel added the status: waiting-for-feedback We need additional information before we can continue label Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-feedback We need additional information before we can continue status: waiting-for-triage An issue we've not yet triaged
Projects
None yet
Development

No branches or pull requests

3 participants