From 1490b32e260ad9da99cbd898adc6330158e2765c Mon Sep 17 00:00:00 2001 From: maliming Date: Wed, 11 Mar 2026 09:42:37 +0800 Subject: [PATCH] fix: only enable browser request streaming over HTTPS in Blazor WASM SetBrowserRequestStreamingEnabled(true) requires HTTP/2, which browsers only support over TLS (ALPN). When the target API uses plain HTTP, the browser fails with ERR_ALPN_NEGOTIATION_FAILED on POST/PUT requests. This change conditionally enables streaming only for HTTPS requests, preserving the large file upload capability while fixing HTTP-only development scenarios. --- .../WebAssembly/AbpBlazorClientHttpMessageHandler.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/AbpBlazorClientHttpMessageHandler.cs b/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/AbpBlazorClientHttpMessageHandler.cs index 88855e3fc5..5e1ce7545c 100644 --- a/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/AbpBlazorClientHttpMessageHandler.cs +++ b/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/AbpBlazorClientHttpMessageHandler.cs @@ -53,7 +53,10 @@ public class AbpBlazorClientHttpMessageHandler : DelegatingHandler, ITransientDe options.Type = UiPageProgressType.Info; }); - request.SetBrowserRequestStreamingEnabled(true); + if (request.RequestUri?.Scheme == Uri.UriSchemeHttps) + { + request.SetBrowserRequestStreamingEnabled(true); + } await SetLanguageAsync(request, cancellationToken); await SetAntiForgeryTokenAsync(request); await SetTimeZoneAsync(request);