diff --git a/src/Microsoft.AspNet.Mvc.Core/Formatters/StringOutputFormatter.cs b/src/Microsoft.AspNet.Mvc.Core/Formatters/StringOutputFormatter.cs index 6a8bb81bee..494a807e99 100644 --- a/src/Microsoft.AspNet.Mvc.Core/Formatters/StringOutputFormatter.cs +++ b/src/Microsoft.AspNet.Mvc.Core/Formatters/StringOutputFormatter.cs @@ -34,8 +34,12 @@ public override bool CanWriteResult(OutputFormatterCanWriteContext context) // always return it as a text/plain format. if (context.ObjectType == typeof(string) || context.Object is string) { - context.ContentType = new StringSegment(SupportedMediaTypes[0]); - return true; + if (context.ContentType == null) + { + context.ContentType = new StringSegment(SupportedMediaTypes[0]); + } + + return true; } return false;