We're observing numerous exceptions like this (the bottom the stack trace may vary per different middleware) while we never attempt to modify ContentLength:
System.InvalidOperationException: This operation cannot be performed after the response has been submitted.
at System.Net.HttpListenerResponse.set_ContentLength64(Int64 value)
at Microsoft.Owin.Host.HttpListener.RequestProcessing.HeadersDictionaryBase.Set(String key, String[] value)
at System.Web.Http.Owin.HttpMessageHandlerAdapter.SendResponseMessageAsync(HttpRequestMessage request, HttpResponseMessage response, IOwinResponse owinResponse, CancellationToken cancellationToken)
at System.Web.Http.Owin.HttpMessageHandlerAdapter.<InvokeCore>d__20.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Owin.Security.Infrastructure.AuthenticationMiddleware`1.<Invoke>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.AAD.Throttling.GatewayService.Middleware.Reporting.LoggerMiddleware.<Invoke>d__8.MoveNext() in C:\source\src\Service\GatewayService\Middleware\Reporting\LoggerMiddleware.cs:line 44
We're observing numerous exceptions like this (the bottom the stack trace may vary per different middleware) while we never attempt to modify
ContentLength
:Environment:
Packages: