diff options
author | Jürgen Thomann <juergen_thomann@linfre.de> | 2022-05-06 11:22:39 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-06 11:22:39 +0300 |
commit | f4f46a2989ee32f9d48672e1002b6abf774cda28 (patch) | |
tree | 6e4c03c34cbdd5ad53a538efaad293422b21d57c /core | |
parent | 1fa21250b43706fc2859015d0b465c01d32d1095 (diff) |
Add support to exclude hosts from proxy (#19139)
Diffstat (limited to 'core')
-rw-r--r-- | core/Http.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/core/Http.php b/core/Http.php index ae9b0b4114..d944f5fb25 100644 --- a/core/Http.php +++ b/core/Http.php @@ -1096,6 +1096,16 @@ class Http $proxyPort = Config::getInstance()->proxy['port']; $proxyUser = Config::getInstance()->proxy['username']; $proxyPassword = Config::getInstance()->proxy['password']; + $proxyExclude = Config::getInstance()->proxy['exclude']; + + if (!empty($proxyExclude)) { + $excludes = explode(',', $proxyExclude); + $excludes = array_map('trim', $excludes); + $excludes = array_filter($excludes); + if (in_array($hostname, $excludes)) { + return array(null, null, null, null); + } + } return array($proxyHost, $proxyPort, $proxyUser, $proxyPassword); } |