Skip to content

Commit 3b59deb

Browse files
authored
Fix LocationResult status code 409 not taking effect (kapi2289#14)
* Fix LocationResult status code 409 not taking effect * fix GetRequiredService TempDataDictionaryFactor bug
1 parent e2cb19d commit 3b59deb

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

InertiaCore/Extensions/Configure.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public static IServiceCollection AddViteHelper(this IServiceCollection services,
6464

6565
private static async Task OnVersionChange(HttpContext context, IApplicationBuilder app)
6666
{
67-
var tempData = app.ApplicationServices.GetRequiredService<TempDataDictionaryFactory>()
67+
var tempData = app.ApplicationServices.GetRequiredService<ITempDataDictionaryFactory>()
6868
.GetTempData(context);
6969

7070
if (tempData.Any()) tempData.Keep();

InertiaCore/Utils/LocationResult.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ public async Task ExecuteResultAsync(ActionContext context)
1616
{
1717
context.HttpContext.Response.Headers.Add("X-Inertia-Location", _url);
1818
await new StatusCodeResult((int)HttpStatusCode.Conflict).ExecuteResultAsync(context);
19+
return;
1920
}
2021

2122
await new RedirectResult(_url).ExecuteResultAsync(context);

0 commit comments

Comments
 (0)