most likely the request is timing out. the timeout is what sets the cancellation token.
Why my ASP.NET razor page app cannot access a specific endpoint?
I have an issue with my ASP.NET app where it cannot access a specific endpoint. It throws a 502 error in Azure and a request timed out on my local machine. The endpoint I want to access is the products endpoint. I found that HttpContext.RequestAborted.IsCancellationRequested
is set to true after passing through a certain middleware, which I can't identify since it is a built-in middleware and I cannot put a breakpoint on it. I noticed this because I have a custom middleware, and before calling the await _next(httpContext);
method, IsCancellationRequested
is set to false. However, after it is called, IsCancellationRequested
is set to true, which I believe is the main reason for the error. Additionally, I discovered that I can access the products endpoint in incognito mode because IsCancellationRequested
is always false whether before or after calling await _next(httpContext);
, which is quite strange.