From f86cf7cd0922350d67140b38f2df7521494f67f6 Mon Sep 17 00:00:00 2001 From: "Aapeli.Smith" <44763019+aapelismith@users.noreply.github.com> Date: Fri, 4 Apr 2025 13:32:16 +0800 Subject: [PATCH] Update http_impl.dart MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix(proxy): correct userinfo validation logic  - Fix incorrect length check by using userinfo.length instead of proxy.length --- sdk/lib/_http/http_impl.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/lib/_http/http_impl.dart b/sdk/lib/_http/http_impl.dart index c3405e5a4020..45d11b122fe1 100644 --- a/sdk/lib/_http/http_impl.dart +++ b/sdk/lib/_http/http_impl.dart @@ -3746,7 +3746,7 @@ class _ProxyConfiguration { String userinfo = proxy.substring(0, at).trim(); proxy = proxy.substring(at + 1).trim(); int colon = userinfo.indexOf(":"); - if (colon == -1 || colon == 0 || colon == proxy.length - 1) { + if (colon == -1 || colon == 0 || colon == userinfo.length - 1) { throw HttpException("Invalid proxy configuration $configuration"); } username = userinfo.substring(0, colon).trim();