Handle removal of HttpResponse.SendAsync extension.

This commit is contained in:
Chris Ross 2015-04-23 11:40:47 -07:00
parent b27c6fc1e2
commit af641b1ca5
3 changed files with 8 additions and 4 deletions

View File

@ -69,7 +69,8 @@ namespace StatusCodePagesSample
builder.AppendLine("<a href=\"" + HtmlEncoder.Default.HtmlEncode(referrer) + "\">Retry " + WebUtility.HtmlEncode(referrer) + "</a><br>");
}
builder.AppendLine("</body></html>");
await context.Response.SendAsync(builder.ToString(), "text/html");
context.Response.ContentType = "text/html";
await context.Response.WriteAsync(builder.ToString());
});
});
@ -94,7 +95,8 @@ namespace StatusCodePagesSample
}
builder.AppendLine("</body></html>");
await context.Response.SendAsync(builder.ToString(), "text/html");
context.Response.ContentType = "text/html";
await context.Response.WriteAsync(builder.ToString());
});
}
}

View File

@ -60,7 +60,8 @@ namespace Microsoft.AspNet.Builder
return UseStatusCodePages(app, context =>
{
var body = string.Format(CultureInfo.InvariantCulture, bodyFormat, context.HttpContext.Response.StatusCode);
return context.HttpContext.Response.SendAsync(body, contentType);
context.HttpContext.Response.ContentType = contentType;
return context.HttpContext.Response.WriteAsync(body);
});
}

View File

@ -23,7 +23,8 @@ namespace Microsoft.AspNet.Diagnostics
var statusCode = context.HttpContext.Response.StatusCode;
var body = string.Format(CultureInfo.InvariantCulture, "Status Code: {0}; {1}",
statusCode, ReasonPhrases.GetReasonPhrase(statusCode)) + new string(' ', 500);
return context.HttpContext.Response.SendAsync(body, "text/plain");
context.HttpContext.Response.ContentType = "text/plain";
return context.HttpContext.Response.WriteAsync(body);
};
}