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

Do not use chunked transfer encoding on ASP.NET Core 2.1 #1016

Merged
merged 1 commit into from
Feb 9, 2024

Conversation

vidrenning
Copy link
Contributor

Setting the Content-Length header explicitly will disable chunked transfer-encoding. However this was only done for one of the two WriteMessageAsync methods in SoapMessageEncoder. I have changed the other method to also set the Content-Length header.

To do this I have used a MemoryStream. The other implementation used a StringWriter, which is not ideal, because it will convert to and from different encodings. We only want to find out the length of the stream, so a MemoryStream is faster and sufficient. Also changed the other WriteMessageAsync implementation to use a MemoryStream and removed the CustomStringWriter class.

Fixes #1015

Setting the Content-Length header explicitly will disable chunked
transfer-encoding. However this was only done for one of the two
WriteMessageAsync methods in SoapMessageEncoder. I have changed the
other method to also set the Content-Length header.

To do this I have used a MemoryStream. The other implementation used
a StringWriter, which is not ideal, because it will convert to and from
different encodings. We only want to find out the length of the stream,
so a MemoryStream is faster and sufficient. Also changed the other
WriteMessageAsync implementation to use a MemoryStream and removed the
CustomStringWriter class.

Fixes DigDes#1015
@andersjonsson andersjonsson merged commit 22ecb5c into DigDes:develop Feb 9, 2024
3 checks passed
@vidrenning vidrenning deleted the chunked branch February 9, 2024 13:03
@vidrenning
Copy link
Contributor Author

Thanks for merging!

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

Successfully merging this pull request may close these issues.

SoapCore uses chunked transfer-encoding on netstandard2.0 version
2 participants