diff --git a/lib/functions.php b/lib/functions.php
index 96dd9551731d1b750b9212aa9460f8b397a44d46..85bfd5e778b67572c9d619b8334b006b7974bc04 100644
--- a/lib/functions.php
+++ b/lib/functions.php
@@ -1816,8 +1816,12 @@ function get_default_http_stream_context($url = '')
         }
         $host = $purl['host'];
         $whitelist = array_filter(array_map('trim', explode(',', Config::get()->HTTP_PROXY_IGNORE)));
-        if (in_array($host, $whitelist)) {
-            $proxy = '';
+
+        foreach ($whitelist as $whitehost) {
+            if (fnmatch($whitehost, $host)) {
+                $proxy = '';
+                break;
+            }
         }
     }
     if ($proxy) {