internal HttpResponseMessage GenerateResponse()
{
_sendingHeaders();
var response = new HttpResponseMessage
{
StatusCode = (HttpStatusCode) OwinContext.Response.StatusCode,
ReasonPhrase = OwinContext.Response.ReasonPhrase,
RequestMessage = _request,
Content = new StreamContent(_responseStream)
};
// response.Version = owinResponse.Protocol;
foreach (var header in OwinContext.Response.Headers)
{
if (!response.Headers.TryAddWithoutValidation(header.Key, header.Value))
{
response.Content.Headers.TryAddWithoutValidation(header.Key, header.Value);
}
}
return response;
}