[Fixes #112] BaseView.ExecuteAsync disposes the response stream
This commit is contained in:
parent
f7e7ce53a5
commit
8c8490fab4
|
|
@ -6,6 +6,7 @@ using System;
|
|||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNet.Http;
|
||||
using Microsoft.Framework.Internal;
|
||||
|
|
@ -52,7 +53,7 @@ namespace Microsoft.AspNet.Diagnostics.Views
|
|||
Context = context;
|
||||
Request = Context.Request;
|
||||
Response = Context.Response;
|
||||
Output = new StreamWriter(Response.Body);
|
||||
Output = new StreamWriter(Response.Body, Encoding.UTF8, 4096, leaveOpen: true);
|
||||
HtmlEncoder = context.ApplicationServices.GetHtmlEncoder();
|
||||
await ExecuteAsync();
|
||||
Output.Dispose();
|
||||
|
|
@ -199,7 +200,7 @@ namespace Microsoft.AspNet.Diagnostics.Views
|
|||
/// <param name="value">The <see cref="object"/> to write.</param>
|
||||
/// <remarks>
|
||||
/// <see cref="HelperResult.WriteTo(TextWriter)"/> is invoked for <see cref="HelperResult"/> types.
|
||||
/// For all other types, the encoded result of <see cref="object.ToString"/> is written to the
|
||||
/// For all other types, the encoded result of <see cref="object.ToString"/> is written to the
|
||||
/// <paramref name="writer"/>.
|
||||
/// </remarks>
|
||||
protected void WriteTo(TextWriter writer, object value)
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ using Views
|
|||
#line 10 "CompilationErrorPage.cshtml"
|
||||
|
||||
Response.StatusCode = 500;
|
||||
Response.ContentType = "text/html";
|
||||
Response.ContentType = "text/html; charset=utf-8";
|
||||
Response.ContentLength = null; // Clear any prior Content-Length
|
||||
|
||||
#line default
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
}
|
||||
@{
|
||||
Response.StatusCode = 500;
|
||||
Response.ContentType = "text/html";
|
||||
Response.ContentType = "text/html; charset=utf-8";
|
||||
Response.ContentLength = null; // Clear any prior Content-Length
|
||||
}
|
||||
<!DOCTYPE html>
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ using Views
|
|||
|
||||
Response.StatusCode = 500;
|
||||
// TODO: Response.ReasonPhrase = "Internal Server Error";
|
||||
Response.ContentType = "text/html";
|
||||
Response.ContentType = "text/html; charset=utf-8";
|
||||
Response.ContentLength = null; // Clear any prior Content-Length
|
||||
string location = string.Empty;
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
@{
|
||||
Response.StatusCode = 500;
|
||||
// TODO: Response.ReasonPhrase = "Internal Server Error";
|
||||
Response.ContentType = "text/html";
|
||||
Response.ContentType = "text/html; charset=utf-8";
|
||||
Response.ContentLength = null; // Clear any prior Content-Length
|
||||
string location = string.Empty;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue