Skip to content

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

Merged
sumanmaity1234 merged 2 commits intootto-de:mainfrom
marczimmermann1234:main
Feb 7, 2025
Merged

Add "Content-Length" in HTTP POST request header to fix notifications to MS Teams workflows#965
sumanmaity1234 merged 2 commits intootto-de:mainfrom
marczimmermann1234:main

Conversation

@marczimmermann1234
Copy link
Contributor

@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
@boring-cyborg
Copy link

boring-cyborg bot commented Jan 28, 2025

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

@sumanmaity1234 sumanmaity1234 merged commit fac50d2 into otto-de:main Feb 7, 2025
@boring-cyborg
Copy link

boring-cyborg bot commented Feb 7, 2025

Awesome work, congrats on your first merged pull request!

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.

2 participants

Comments