title: Kestrel + IIS Reverse Proxy RequestAborted Not Triggered
body: <p>We have an ASP.NET Core 2.x Application that implements custom middleware that acts as a proxy in front of another (Java based) server/application. It is common for the clients of this application/middleware to frequently abort/cancel their request before the server request has completed.</p>
  
  <p>We've deployed this application to IIS (as a reverse proxy) and running on Kestrel. <a href="https://github.com/aspnet/KestrelHttpServer/issues/1139" rel="nofollow noreferrer">Prior to Core 2.x Kestrel had a bug that caused <code>HttpContext.RequestAborted</code> to always be <code>false</code></a> (other related question <a href="https://stackoverflow.com/questions/39574061/httprequest-not-aborted-cancelled-on-browser-abort-in-asp-net-core-mvc">here</a>)...which was apparently fixed in 2.x (which I've been able to confirm). </p>
  
  <p>However, it appears that when running IIS in front of Kestrel, it doesn't forward the request abort through to Kestrel and <code>RequestAborted</code> is <strong>still</strong> always <code>false</code> </p>
  
  <p>Is there any way to get <code>RequestAborted</code> working in this configuration (or any other way to detect it if not)? </p>
  
  <p>Simple reproduction repo: <a href="https://github.com/mikeomeara1/RequestAbortRepro" rel="nofollow noreferrer">https://github.com/mikeomeara1/RequestAbortRepro</a></p>
  
  <p><strong>UPDATE</strong></p>
  
  <p><a href="https://github.com/aspnet/KestrelHttpServer/issues/1139#issuecomment-258281409" rel="nofollow noreferrer">This Comment</a> seems to indicate a known issue but it's largely unclear to what extent</p>
  
  <p><a href="https://github.com/aspnet/AspNetCoreModule/issues/38" rel="nofollow noreferrer">This Question</a> seems to also be related but again it's not completely apparent to me that it's directly related (at least it isn't spelled out in such terms).</p>
  
  <p>@spender - If I understood you correctly, the header comparison is <a href="https://gist.github.com/mikeomeara1/b2bf4f18099c8705471b7f895c7cc0fb" rel="nofollow noreferrer">here</a>. If not, let me know, I'll get you whatever you want to see.</p>
  
  <p>It seems the tea leaves are indicating a known issue. So, the question is; Is there a way to work around this? We just went through (a very painful) 1.1 to 2.x upgrade in the hopes this issue would be addressed and letting our server thrash for another month/quarter/year has us pretty concerned at this point. The system we're working on is greatly scaling up in volume. </p>
  
  <p>So, any workarounds, hacks or crazy ideas are welcome.</p>