Please check the type of change your PR introduces:
[X] Bugfix
[ ] Feature
[ ] Code style update (formatting, renaming)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] Documentation content changes
[ ] Other (please describe):
What is the current behavior?
An exception is thrown when using the reverse proxy response writer and the called server returns an HTTP 204. An empty body is written to the response, which is not allowed by .NET, which results in an exception.
What is the new behavior?
At first, a check was done that the returned response is not null before writing the stub response. Since an empty body is not null, the empty body was written and an exception was thrown. Now, we also check whether the body has contents before writing it to the response.
Pull request type
Please check the type of change your PR introduces:
What is the current behavior?
An exception is thrown when using the reverse proxy response writer and the called server returns an HTTP 204. An empty body is written to the response, which is not allowed by .NET, which results in an exception.
What is the new behavior?
At first, a check was done that the returned response is not null before writing the stub response. Since an empty body is not null, the empty body was written and an exception was thrown. Now, we also check whether the body has contents before writing it to the response.
Does this introduce a breaking change?