<commit_before>﻿// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.

using System.Collections.Generic;
using System.Net.Http;

namespace System.Web.Http.WebHost
{
    internal static class HttpRequestMessageExtensions
    {
        internal static readonly string HttpContextBaseKey = "MS_HttpContext";

        public static HttpContextBase GetHttpContext(this HttpRequestMessage request)
        {
            if (request == null)
            {
                throw new ArgumentNullException("request");
            }

            HttpContextBase context;

            if (!request.Properties.TryGetValue(HttpContextBaseKey, out context))
            {
                context = null;
            }

            return context;
        }

        public static void SetHttpContext(this HttpRequestMessage request, HttpContextBase context)<commit_msg>Incorporate code review feedback.<commit_after>﻿// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.

using System.Collections.Generic;
using System.Net.Http;

namespace System.Web.Http.WebHost
{
    internal static class HttpRequestMessageExtensions
    {
        private const string HttpContextBaseKey = "MS_HttpContext";

        public static HttpContextBase GetHttpContext(this HttpRequestMessage request)
        {
            if (request == null)
            {
                throw new ArgumentNullException("request");
            }

            HttpContextBase context;

            if (!request.Properties.TryGetValue(HttpContextBaseKey, out context))
            {
                context = null;
            }

            return context;
        }

        public static void SetHttpContext(this HttpRequestMessage request, HttpContextBase context)
{'fraction_non_alphanumeric': 0.06446457112413426, 'fraction_numerical': 0.0, 'mean_word_length': 2.4145454545454546, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2367366', 'n_tokens_mistral': 434, 'n_tokens_neox': 415, 'n_words': 131}