fix for no proxy when port numbers used

Ken Fox (kfox@ford.com)
Fri, 29 Sep 1995 14:07:05 -0400 (EDT)


I had problems with the no_proxy variable set to a domain name and a URL
having a port number --- the no_proxy tried to match host and port number in
the URL against the domain name without port number.  This simple little
patch just scans the no_proxy without the URL's port number, then again with
the port number (if necessary.)

This mail message should go through patch automatically --- apply in the
libwww-perl-0.40 directory.

- Ken

-- 
Ken Fox, fox@pt0204.pto.ford.com, (313)59-44794
-------------------------------------------------------------------------
Ford Motor Company, Powertrain    | "Is this some sort of trick question
Analytical Powertrain Methods     |  or what?" -- Calvin
AP Environment Section            |
-------------------------------------------------------------------------

*** www.pl.DIST	Thu Jun 22 13:09:40 1995
--- www.pl	Fri Sep 29 13:59:54 1995
***************
*** 244,253 ****
  
      if ($NoProxy)
      {
!         if ($port) { $host .= ":$port"; }
          foreach $domain (@DontProxy)
          {
              return '' if ($host =~ m/$domain$/i);
          }
      }
  
--- 244,265 ----
  
      if ($NoProxy)
      {
!         # first scan the no_proxy list without the port number (assume
!         # that any host listed in the no_proxy list without a port number
!         # should not be proxied on *any* port number)
          foreach $domain (@DontProxy)
          {
              return '' if ($host =~ m/$domain$/i);
+         }
+ 
+         # then scan with the port number
+         if ($port)
+         {
+             $host .= ":$port";
+             foreach $domain (@DontProxy)
+             {
+                 return '' if ($host =~ m/$domain$/i);
+             }
          }
      }