File tree Expand file tree Collapse file tree 2 files changed +6
-8
lines changed
Expand file tree Collapse file tree 2 files changed +6
-8
lines changed Original file line number Diff line number Diff line change 11<Project Sdk =" Microsoft.NET.Sdk" >
22 <PropertyGroup >
33 <Version >3.0.0</Version >
4- <TargetFrameworks >netstandard2.0; net8.0</TargetFrameworks >
4+ <TargetFrameworks >net8.0</TargetFrameworks >
55 <AssemblyName >Hellang.Middleware.SpaFallback</AssemblyName >
66 <RootNamespace >Hellang.Middleware.SpaFallback</RootNamespace >
77 <Description >SPA fallback middleware for client-side routing</Description >
88 <PackageReleaseNotes >Added automatic host injection</PackageReleaseNotes >
99 <PackageTags >middleware;spa;routing</PackageTags >
1010 </PropertyGroup >
1111
12- <ItemGroup Condition =" '$(TargetFramework)' == 'netstandard2.0'" >
13- <PackageReference Include =" Microsoft.AspNetCore.Hosting.Abstractions" Version =" 2.1.1" />
14- <PackageReference Include =" Microsoft.Extensions.Options" Version =" 2.1.1" />
15- </ItemGroup >
16-
17- <ItemGroup Condition =" '$(TargetFramework)' == 'net8.0'" >
12+ <ItemGroup >
1813 <FrameworkReference Include =" Microsoft.AspNetCore.App" />
1914 </ItemGroup >
2015
Original file line number Diff line number Diff line change 1- using System . Threading . Tasks ;
1+ using System . Threading . Tasks ;
22using Microsoft . AspNetCore . Http ;
33using Microsoft . Extensions . Options ;
44
@@ -38,6 +38,9 @@ private async Task Fallback(HttpContext context)
3838
3939 context . Request . Path = fallbackPath ;
4040
41+ // Reset HTTP response headers, status code and the response body to make room for the redirected endpoint content.
42+ context . Response . Clear ( ) ;
43+
4144 await Next ( context ) ;
4245
4346 if ( context . ShouldThrow ( Options ) )
You can’t perform that action at this time.
0 commit comments