Skip to content
This repository was archived by the owner on Dec 14, 2018. It is now read-only.

Commit 9a0d0d4

Browse files
committed
Updated
1 parent b871516 commit 9a0d0d4

File tree

5 files changed

+11
-7
lines changed

5 files changed

+11
-7
lines changed

src/Microsoft.AspNet.Mvc.Core/ActionResults/ContentResult.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ public class ContentResult : ActionResult
2020

2121
public string Content { get; set; }
2222

23+
/// <summary>
24+
/// Gets or sets the <see cref="MediaTypeHeaderValue"/> representing the Content-Type header of the response.
25+
/// </summary>
2326
public MediaTypeHeaderValue ContentType { get; set; }
2427

2528
/// <summary>

src/Microsoft.AspNet.Mvc.Core/ActionResults/FileResult.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ protected FileResult([NotNull] MediaTypeHeaderValue contentType)
4040
}
4141

4242
/// <summary>
43-
/// Gets or sets the Content-Type header value that will be written to the response.
43+
/// Gets the <see cref="MediaTypeHeaderValue"/> representing the Content-Type header of the response.
4444
/// </summary>
4545
public MediaTypeHeaderValue ContentType { get; }
4646

src/Microsoft.AspNet.Mvc.Core/ActionResults/ViewExecutor.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ public static async Task ExecuteAsync([NotNull] IView view,
6262

6363
var wrappedStream = new StreamWrapper(response.Body);
6464

65+
// StreamWriter writes the preamble or BOM bytes to the response if the encoding requires it.
66+
// Since preamble bytes are unnecessary when generating dynamic content, wrap the original encoding
67+
// to avoid writing the preamble bytes.
6568
using (var writer = new StreamWriter(
6669
wrappedStream,
6770
new ResponseEncodingWrapper(encoding),

test/Microsoft.AspNet.Mvc.Core.Test/ActionResults/ContentResultTest.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-

2-
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
1+
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
32
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
43

5-
using System;
64
using System.IO;
75
using System.Text;
86
using System.Threading.Tasks;

test/Microsoft.AspNet.Mvc.Core.Test/ActionResults/FilePathResultTest.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33

44
using System.IO;
5+
using System.Text;
56
using System.Threading;
67
using System.Threading.Tasks;
78
using Microsoft.AspNet.FileProviders;
89
using Microsoft.AspNet.Hosting;
910
using Microsoft.AspNet.Http;
1011
using Microsoft.AspNet.Routing;
1112
using Microsoft.Framework.DependencyInjection;
13+
using Microsoft.Net.Http.Headers;
1214
using Moq;
1315
using Xunit;
14-
using System.Text;
15-
using Microsoft.Net.Http.Headers;
1616

1717
namespace Microsoft.AspNet.Mvc
1818
{
@@ -117,7 +117,7 @@ public async Task ExecuteResultAsync_SetsSuppliedContentTypeAndEncoding()
117117
{
118118
// Arrange
119119
var expectedContentType = "text/foo; charset=us-ascii";
120-
// path will be C:/.../TestFiles/FilePathResultTestFile.txt
120+
// path will be C:/.../TestFiles/FilePathResultTestFile_ASCII.txt
121121
var path = Path.GetFullPath(Path.Combine(".", "TestFiles", "FilePathResultTestFile_ASCII.txt"));
122122
path = path.Replace(@"\", "/");
123123

0 commit comments

Comments
 (0)