HF RL Explorer

Task: Safely Set User Principal in Custom WebAPI HttpMessageHandler

Task: Safely Set User Principal in Custom WebAPI HttpMessageHandler: a task in Terminal-Lego-15k (Harbor dataset). In ASP.NET Web API, when using a custom HttpMessageHandler for basic authentication, setting Thread.CurrentPrincipal can fail intermittently due to thread switching — particularly…

The task

In ASP.NET Web API, when using a custom `HttpMessageHandler` for basic authentication, setting `Thread.CurrentPrincipal` can fail intermittently due to thread switching — particularly when a custom `MediaTypeFormatter` uses `Task.Factory.StartNew`, which may cause the controller action to execute on a different…

Part of PrimeIntellect/Terminal-Lego-15k.