File tree Expand file tree Collapse file tree 3 files changed +16
-7
lines changed
src/BuiltInTools/BrowserRefresh Expand file tree Collapse file tree 3 files changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -140,8 +140,8 @@ This file should be imported by eng/Versions.props
140
140
<!-- dotnet/core-setup dependencies -->
141
141
<NETStandardLibraryRefPackageVersion >2.1.0</NETStandardLibraryRefPackageVersion >
142
142
<!-- microsoft/testfx dependencies -->
143
- <MicrosoftTestingPlatformPackageVersion >1.9.0-preview.25430.5 </MicrosoftTestingPlatformPackageVersion >
144
- <MSTestPackageVersion >3.11.0-preview.25430.5 </MSTestPackageVersion >
143
+ <MicrosoftTestingPlatformPackageVersion >1.9.0-preview.25451.2 </MicrosoftTestingPlatformPackageVersion >
144
+ <MSTestPackageVersion >3.11.0-preview.25451.2 </MSTestPackageVersion >
145
145
</PropertyGroup >
146
146
<!-- Property group for alternate package version names-->
147
147
<PropertyGroup >
Original file line number Diff line number Diff line change 553
553
<Uri >https://github.com/dotnet/dotnet</Uri >
554
554
<Sha >7ac1ca67bb1fb8a381c1c94a9f82a97725f0ccf3</Sha >
555
555
</Dependency >
556
- <Dependency Name =" Microsoft.Testing.Platform" Version =" 1.9.0-preview.25430.5 " >
556
+ <Dependency Name =" Microsoft.Testing.Platform" Version =" 1.9.0-preview.25451.2 " >
557
557
<Uri >https://github.com/microsoft/testfx</Uri >
558
- <Sha >9d2e740bc8be46f45c6d69b33be1f5a913bf6231 </Sha >
558
+ <Sha >8d29291af97543579834e9109768c5ee89f63638 </Sha >
559
559
</Dependency >
560
- <Dependency Name =" MSTest" Version =" 3.11.0-preview.25430.5 " >
560
+ <Dependency Name =" MSTest" Version =" 3.11.0-preview.25451.2 " >
561
561
<Uri >https://github.com/microsoft/testfx</Uri >
562
- <Sha >9d2e740bc8be46f45c6d69b33be1f5a913bf6231 </Sha >
562
+ <Sha >8d29291af97543579834e9109768c5ee89f63638 </Sha >
563
563
</Dependency >
564
564
<Dependency Name =" Microsoft.Extensions.Configuration.Ini" Version =" 10.0.0-rc.2.25427.104" >
565
565
<Uri >https://github.com/dotnet/dotnet</Uri >
Original file line number Diff line number Diff line change @@ -164,7 +164,8 @@ internal static bool IsBrowserDocumentRequest(HttpContext context)
164
164
165
165
if ( request . Headers . TryGetValue ( "Sec-Fetch-Dest" , out var values ) &&
166
166
! StringValues . IsNullOrEmpty ( values ) &&
167
- ! string . Equals ( values [ 0 ] , "document" , StringComparison . OrdinalIgnoreCase ) )
167
+ ! string . Equals ( values [ 0 ] , "document" , StringComparison . OrdinalIgnoreCase ) &&
168
+ ! IsProgressivelyEnhancedNavigation ( context . Request ) )
168
169
{
169
170
// See https://github.com/dotnet/aspnetcore/issues/37326.
170
171
// Only inject scripts that are destined for a browser page.
@@ -188,6 +189,14 @@ internal static bool IsBrowserDocumentRequest(HttpContext context)
188
189
return false ;
189
190
}
190
191
192
+ private static bool IsProgressivelyEnhancedNavigation ( HttpRequest request )
193
+ {
194
+ // This is an exact copy from https://github.com/dotnet/aspnetcore/blob/bb2d778dc66aa998ea8e26db0e98e7e01423ff78/src/Components/Endpoints/src/Rendering/EndpointHtmlRenderer.Streaming.cs#L327-L332
195
+ // For enhanced nav, the Blazor JS code controls the "accept" header precisely, so we can be very specific about the format
196
+ var accept = request . Headers . Accept ;
197
+ return accept . Count == 1 && string . Equals ( accept [ 0 ] ! , "text/html; blazor-enhanced-nav=on" , StringComparison . Ordinal ) ;
198
+ }
199
+
191
200
internal void Test_SetEnvironment ( string dotnetModifiableAssemblies , string aspnetcoreBrowserTools )
192
201
{
193
202
_dotnetModifiableAssemblies = dotnetModifiableAssemblies ;
You can’t perform that action at this time.
0 commit comments