Ignore response content if null (fix #785) (#786)

This commit is contained in:
Chris Swinchatt
2019-02-20 14:16:55 +00:00
committed by Marcelo Castagna
parent a9cfc04aa9
commit 26ae9948d5
2 changed files with 26 additions and 4 deletions

View File

@ -39,6 +39,23 @@ namespace Ocelot.UnitTests.Responder
header.ShouldBeEmpty();
}
[Fact]
public void should_ignore_content_if_null()
{
var httpContext = new DefaultHttpContext();
var response = new DownstreamResponse(null, HttpStatusCode.OK,
new List<KeyValuePair<string, IEnumerable<string>>>(), "some reason");
Should.NotThrow(() =>
{
_responder
.SetResponseOnHttpContext(httpContext, response)
.GetAwaiter()
.GetResult()
;
});
}
[Fact]
public void should_have_content_length()
{