From 5ff06ea147833ca182cc2de1fe25c2d9ef1e1552 Mon Sep 17 00:00:00 2001 From: anjihang <273770137@qq.com> Date: Fri, 30 Jul 2021 11:57:29 +0800 Subject: [PATCH] fix: override findProxyFromEnvironment --- kraken/lib/src/foundation/http_overrides.dart | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/kraken/lib/src/foundation/http_overrides.dart b/kraken/lib/src/foundation/http_overrides.dart index d16c6018b2..dcc95831b6 100644 --- a/kraken/lib/src/foundation/http_overrides.dart +++ b/kraken/lib/src/foundation/http_overrides.dart @@ -61,6 +61,15 @@ class KrakenHttpOverrides extends HttpOverrides { return httpClient; } + @override + String findProxyFromEnvironment(Uri url, Map? environment) { + if (parentHttpOverrides != null) { + return parentHttpOverrides!.findProxyFromEnvironment(url, environment); + } else { + return super.findProxyFromEnvironment(url, environment); + } + } + bool shouldOverride(HttpClientRequest request) { String? contextId = request.headers.value(HttpHeaderContextID); return contextId != null && _contextIdToHttpClientInterceptorMap.containsKey(contextId);