<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 Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http.Features;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;

namespace ServerComparison.TestSites
{
    public class StartupResponseCompression
    {
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddResponseCompression("text/plain");
        }

        public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory)
        {
            loggerFactory.AddConsole(minLevel: LogLevel.Warning);
            
            // NGinx's default min size is 20 bytes
            var helloWorldBody = "Hello World;" + new string('a', 20);

            app.Map("/NoAppCompression", subApp =>
            {
                subApp.Run(context =>
                {
                    context.Response.ContentType = "text/plain";
                    context.Response.ContentLength = helloWorldBody.Length;
                    return context.Response.WriteAsync(helloWorldBody);
                });
            });
<commit_msg>React to ResponseCompression API change<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 Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http.Features;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;

namespace ServerComparison.TestSites
{
    public class StartupResponseCompression
    {
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddResponseCompression();
        }

        public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory)
        {
            loggerFactory.AddConsole(minLevel: LogLevel.Warning);
            
            // NGinx's default min size is 20 bytes
            var helloWorldBody = "Hello World;" + new string('a', 20);

            app.Map("/NoAppCompression", subApp =>
            {
                subApp.Run(context =>
                {
                    context.Response.ContentType = "text/plain";
                    context.Response.ContentLength = helloWorldBody.Length;
                    return context.Response.WriteAsync(helloWorldBody);
                });
            });

{'fraction_non_alphanumeric': 0.08179723502304148, 'fraction_numerical': 0.004608294930875576, 'mean_word_length': 2.3312020460358056, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '3631837', 'n_tokens_mistral': 629, 'n_tokens_neox': 609, 'n_words': 154}