私は、特定のURLが要求されたときにIISが基本的に何もしないようにするために、私がサーバサイドからレンダリングしたルータを反応させてリクエストを処理する必要があるからです。このlinkミドルウェアでのリクエストを無視する
を使用し
私は、各要求をチェックし、中央を作成しました。今私は右のURLを見つけると、この要求を無視するか、中止するかを知らない。
public class IgnoreRouteMiddleware
{
private readonly RequestDelegate next;
// You can inject a dependency here that gives you access
// to your ignored route configuration.
public IgnoreRouteMiddleware(RequestDelegate next)
{
this.next = next;
}
public async Task Invoke(HttpContext context)
{
if (context.Request.Path.HasValue &&
context.Request.Path.Value!="/")
{
// cant stop anything here. Want to abort to ignore this request
}
await next.Invoke(context);
}
}