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

Springboot 3.2.0 RestTemplate not setting Content-Length with customized RestTemplate #38841

Closed
hpeimer opened this issue Dec 16, 2023 · 6 comments
Labels
for: external-project For an external project and not something we can fix status: invalid An issue that we don't feel is valid

Comments

@hpeimer
Copy link

hpeimer commented Dec 16, 2023

After upgrading to Springboot 3.2.0 from Springboot 3.1.5, custom RestTemplate is not setting the Content-Length header for requests.

The custom RestTemplate created was created with Apache HttpClient5: 5.2.3. The HttpClient is constructed to ignore hostname verification and SSL verification.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Dec 16, 2023
@scottfrederick
Copy link
Contributor

Thanks for getting in touch. It is difficult for us to know what is going on with the limited information you've provided. If you would like us to spend some time investigating, please provide a complete minimal sample that reproduces the problem. You can share it with us by pushing it to a separate repository on GitHub or by zipping it and attaching it to this issue.

@scottfrederick scottfrederick added the status: waiting-for-feedback We need additional information before we can continue label Dec 16, 2023
@bclozel
Copy link
Member

bclozel commented Dec 16, 2023

This is called out in the Spring Framework upgrade guide at the end of the web section here.

This was done for memory optimization but you can reinstate this behavior.

Edit: also see spring-projects/spring-framework#31854 (comment)

@bclozel bclozel closed this as not planned Won't fix, can't repro, duplicate, stale Dec 16, 2023
@bclozel bclozel added status: invalid An issue that we don't feel is valid for: external-project For an external project and not something we can fix and removed status: waiting-for-feedback We need additional information before we can continue status: waiting-for-triage An issue we've not yet triaged labels Dec 16, 2023
@hpeimer
Copy link
Author

hpeimer commented Dec 16, 2023

Thank you @bclozel

@dvag-erich-achilles
Copy link

Hello, upgrading spring-boot-starter-parent from 3.2.4 to 3.2.5 we got the same error again. As recommended whe still use BufferingClientHttpRequestFactory. Any ideas ?

@bclozel
Copy link
Member

bclozel commented Apr 29, 2024

@dvag-erich-achilles is this for 0 length request bodies? If that's the case, see spring-projects/spring-framework#32678

@dvag-erich-achilles
Copy link

@bclozel yes it is for 0 length request bodies, thank you for your hint.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for: external-project For an external project and not something we can fix status: invalid An issue that we don't feel is valid
Projects
None yet
Development

No branches or pull requests

5 participants