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

Commit

Permalink
* StringOutput set proper ContentType
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanbrandenburg committed Jan 13, 2016
1 parent 6ba05ad commit c7148d6
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit c7148d6

Please sign in to comment.