<commit_before>using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;

namespace WebSocketManager
{
    public static class WebSocketManagerExtensions
    {
        public static IServiceCollection AddWebSocketManager(this IServiceCollection services)
        {
            services.AddTransient<WebSocketConnectionManager>();
            return services;

            //TODO - decide if using reflection to detect *MessageHandlers is necessary
            //so you don't have to manually register all message handlers in Startup
        }

        public static IApplicationBuilder UseWebSocketManager(this IApplicationBuilder app, 
                                                              PathString path,
                                                              WebSocketHandler handler)
        {
            //TODO - break the addition of WebSockets from mapping middleware to paths
            //so that app.UseWebSockets() isn't called multiple times
            app.UseWebSockets();

            //return app.UseMiddleware<WebSocketManagerMiddleware>(path, handler);
            return app.Map(path, (_app) => _app.UseMiddleware<WebSocketManagerMiddleware>(path, handler));
        }
    }
}<commit_msg>Reacted to the removal of _path in middleware<commit_after>using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;

namespace WebSocketManager
{
    public static class WebSocketManagerExtensions
    {
        public static IServiceCollection AddWebSocketManager(this IServiceCollection services)
        {
            services.AddTransient<WebSocketConnectionManager>();
            return services;

            //TODO - decide if using reflection to detect *MessageHandlers is necessary
            //so you don't have to manually register all message handlers in Startup
        }

        public static IApplicationBuilder UseWebSocketManager(this IApplicationBuilder app, 
                                                              PathString path,
                                                              WebSocketHandler handler)
        {
            //TODO - break the addition of WebSockets from mapping middleware to paths
            //so that app.UseWebSockets() isn't called multiple times
            app.UseWebSockets();

            //return app.UseMiddleware<WebSocketManagerMiddleware>(path, handler);
            return app.Map(path, (_app) => _app.UseMiddleware<WebSocketManagerMiddleware>(handler));
        }
    }
}
{'fraction_non_alphanumeric': 0.059027777777777776, 'fraction_numerical': 0.0, 'mean_word_length': 2.1278648974668277, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, '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': '5622751', 'n_tokens_mistral': 545, 'n_tokens_neox': 545, 'n_words': 166}