File tree 2 files changed +3
-2
lines changed
libraries/System.Net.Http/tests/FunctionalTests
2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -584,7 +584,7 @@ public HttpMetricsTest_Http11(ITestOutputHelper output) : base(output)
584
584
{
585
585
}
586
586
587
- [ Fact ]
587
+ [ ConditionalFact ( typeof ( PlatformDetection ) , nameof ( PlatformDetection . IsNotNodeJS ) ) ]
588
588
public async Task RequestDuration_EnrichmentHandler_ContentLengthError_Recorded ( )
589
589
{
590
590
await LoopbackServerFactory . CreateClientAndServerAsync ( async uri =>
Original file line number Diff line number Diff line change @@ -81,9 +81,10 @@ export async function detect_features_and_polyfill(module: DotnetModuleInternal)
81
81
}
82
82
}
83
83
84
- const hasFetch = typeof ( globalThis . fetch ) === "function" ;
85
84
export async function fetch_like ( url : string , init ?: RequestInit ) : Promise < Response > {
86
85
try {
86
+ // this need to be detected only after we import node modules in onConfigLoaded
87
+ const hasFetch = typeof ( globalThis . fetch ) === "function" ;
87
88
if ( ENVIRONMENT_IS_NODE ) {
88
89
const isFileUrl = url . startsWith ( "file://" ) ;
89
90
if ( ! isFileUrl && hasFetch ) {
You can’t perform that action at this time.
0 commit comments