Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. app.Use(async (context, next) =>
  2. {
  3. await next();
  4. if (context.Response.StatusCode == 404 &&
  5. !Path.HasExtension(context.Request.Path.Value) &&
  6. !context.Request.Path.Value.StartsWith("/api/") &&
  7. {
  8. context.Request.Path = "/";
  9. await next();
  10. }
  11. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement