【发布时间】:2017-11-08 08:39:04
【问题描述】:
所以我希望 IIS 在请求某些 url 时基本上不做任何事情,因为我想要从服务器端渲染到的反应路由器来处理请求。
用过这个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);
}
}
【问题讨论】:
标签: asp.net-core react-router-v4 reactjs.net