This commit is contained in:
2019-01-10 23:46:54 +00:00
parent d7c54cca70
commit 0a38df71dd
4 changed files with 52 additions and 47 deletions

View File

@@ -434,7 +434,7 @@ namespace AyaNova
//to support html5 pushstate routing in spa
//this ensures that a refresh at the client will not 404 but rather force back to the index.html app page and then handled internally by the client
await next();
if (context.Request.Path.Value != "/docs" && context.Response.StatusCode == 404 && !Path.HasExtension(context.Request.Path.Value))
if (!context.Response.HasStarted && context.Request.Path.Value != "/docs" && context.Response.StatusCode == 404 && !Path.HasExtension(context.Request.Path.Value))
{
context.Request.Path = "/index.html";
context.Response.StatusCode = 200;