Commit 37b2744b authored by sumanchalki's avatar sumanchalki Committed by mikeytown2
Browse files

Issue #2613136 by roynilanjan, sumanchalki: Pattern matching on proxy-exceptions list

parent 13929e05
......@@ -2874,9 +2874,23 @@ function httprl_pr($input) {
* @return bool
* TRUE if a proxy should be used for this host.
function _httprl_use_proxy($host) {
$proxy_exceptions = httprl_variable_get('proxy_exceptions', array('localhost', ''));
return !in_array(strtolower($host), $proxy_exceptions, TRUE);
// To add a specific domain name in the proxy exception so that all the URL related
// to this domain can bypass the proxy e.g. we add in exception list then
// it can bypass, so even we can get matching pattern.
$proxy_exceptions = httprl_variable_get('proxy_exceptions', array('localhost', '127\.0\.0\.1'));
$use_proxy = TRUE;
if (is_array($proxy_exceptions) && count($proxy_exceptions)) {
foreach ($proxy_exceptions as $exception) {
$match = preg_match("/{$exception}/is", $host);
if ($match) {
$use_proxy = FALSE;
return $use_proxy;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment