<commit_before>// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNet.Http.Features;
using Microsoft.AspNet.Server.Kestrel.Http;

namespace Kestrel
{
    public class ServerRequest : IHttpRequestFeature, IHttpResponseFeature, IHttpUpgradeFeature
    {
        Frame _frame;
        string _scheme;
        string _pathBase;
        private FeatureCollection _features;

        public ServerRequest(Frame frame)
        {
            _frame = frame;
            _features = new FeatureCollection();
            PopulateFeatures();
        }

        private void PopulateFeatures()
        {
            _features.Add(typeof(IHttpRequestFeature), this);
            _features.Add(typeof(IHttpResponseFeature), this);
            _features.Add(typeof(IHttpUpgradeFeature), this);
        }<commit_msg>React to IFeatureCollection changes.<commit_after>// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNet.Http.Features;
using Microsoft.AspNet.Server.Kestrel.Http;

namespace Kestrel
{
    public class ServerRequest : IHttpRequestFeature, IHttpResponseFeature, IHttpUpgradeFeature
    {
        Frame _frame;
        string _scheme;
        string _pathBase;
        private FeatureCollection _features;

        public ServerRequest(Frame frame)
        {
            _frame = frame;
            _features = new FeatureCollection();
            PopulateFeatures();
        }

        private void PopulateFeatures()
        {
            _features[typeof(IHttpRequestFeature)] = this;
            _features[typeof(IHttpResponseFeature)] = this;
            _features[typeof(IHttpUpgradeFeature)] = this;
        }
{'fraction_non_alphanumeric': 0.07852412488174078, 'fraction_numerical': 0.001892147587511826, 'mean_word_length': 2.838475499092559, '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': '942582', 'n_tokens_mistral': 535, 'n_tokens_neox': 536, 'n_words': 149}