fix for #214 and some tests for the class it was in but not for the error (cant be arsed to test as have to spin up IIS) (#218)

This commit is contained in:
Tom Pallister
2018-02-03 09:02:01 +00:00
committed by GitHub
parent 5848e12d15
commit a4bb0dd13b
3 changed files with 66 additions and 6 deletions

View File

@ -55,7 +55,7 @@ namespace Ocelot.Responder
using (Stream stream = new MemoryStream(content))
{
if (response.StatusCode != HttpStatusCode.NotModified)
if (response.StatusCode != HttpStatusCode.NotModified && context.Response.ContentLength != 0)
{
await stream.CopyToAsync(context.Response.Body);
}
@ -79,4 +79,4 @@ namespace Ocelot.Responder
}
}
}
}
}