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

Add "Content-Length" in HTTP POST request header to fix notifications to MS Teams workflows #965

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

marczimmermann1234
Copy link

@marczimmermann1234 marczimmermann1234 commented Jan 28, 2025

From Spring >=6.1 the "Content-Length" header is no longer set by default when using RestTemplate to reduce memory usage. As a result, "Transfer-Encoding: chunked" is used and webhooks in MS Teams workflows do not receive the request body for requests with type application/JSON. To reenable the buffering of request bodies like before (thus setting "the Content-Length" header again), the ClientHttpRequestFactory can be wrapped in a BufferingClientHttpRequestFactory.

@boring-cyborg boring-cyborg bot added the java Changes related to backend label Jan 28, 2025
Copy link

boring-cyborg bot commented Jan 28, 2025

Thanks for opening this pull request! Please check out our contributing guidelines!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
java Changes related to backend
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant