<commit_before>﻿using System.Net.Http;
using System.Net.Http.Formatting;

namespace Microsoft.AspNet.Mvc
{
    public class ActionResultFactory : IActionResultFactory
    {
        public IActionResult CreateActionResult(object actionReturnValue)
        {
            var actionResult = actionReturnValue as IActionResult;

            if (actionResult != null)
            {
                return actionResult;
            }

            var responseMessage = actionReturnValue as HttpResponseMessage;
            if (responseMessage != null)
            {
                return new HttpResponseMessageActionResult(responseMessage);
            }

            // all other object types are treated as an http response message action result
            var content = new ObjectContent(actionReturnValue.GetType(),
                                            actionReturnValue,
                                            new JsonMediaTypeFormatter());

            return new HttpResponseMessageActionResult(new HttpResponseMessage
            {
                Content = content
            });
        }
    }
}
<commit_msg>Treat returned strings as content results.<commit_after>﻿using System.Net.Http;
using System.Net.Http.Formatting;

namespace Microsoft.AspNet.Mvc
{
    public class ActionResultFactory : IActionResultFactory
    {
        public IActionResult CreateActionResult(object actionReturnValue)
        {
            var actionResult = actionReturnValue as IActionResult;

            if (actionResult != null)
            {
                return actionResult;
            }

            var responseMessage = actionReturnValue as HttpResponseMessage;
            if (responseMessage != null)
            {
                return new HttpResponseMessageActionResult(responseMessage);
            }

            if (actionReturnValue is string)
            {
                return new ContentResult
                {
                     Content = (string)actionReturnValue
                };
            }

            // all other object types are treated as an http response message action result
            var content = new ObjectContent(actionReturnValue.GetType(),
                                            actionReturnValue,
                                            new JsonMediaTypeFormatter());

            return new HttpResponseMessageActionResult(new HttpResponseMessage
            {
                Content = content
            });
        }
    }
}

{'fraction_non_alphanumeric': 0.05328525641025641, 'fraction_numerical': 0.0, 'mean_word_length': 1.5610256410256411, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5314299', 'n_tokens_mistral': 514, 'n_tokens_neox': 497, 'n_words': 136}