On Sun, Feb 22, 2009 at 01:21:00PM +0100, Robert Luberda wrote: > Mark Hindley writes: > > Hi, > > >> Sat Jan 3 10:21:02 2009|debug [8421]: Checking host localhost in absolute > >> URI > >> Sat Jan 3 10:21:02 2009|debug [8421]: Host in Absolute URI is not this > >> server > > > > ^^^^^^^ This is the error. localhost should be recognised as the local > > server > > and ignored. > > > > > > I don't want to use this patch as it will break transparent proxying in > > CGI mode. Could you try the patch below and tell me if it is fixed > > I've just tested your patch, and although it fixes the error you marked > above, it does not fix the problem:
Sorry, I am backporting this and I have missed a chunk. You also need this: commit 81f7b6bee58559d56543d7724b33029a1f60cc9b Author: Mark Hindley <m...@hindley.org.uk> Date: Sun Feb 22 20:25:16 2009 +0000 Further fix for #510569. Need to accept multiple initial separators after absolute URI check diff --git a/apt-cacher2 b/apt-cacher2 index cebba37..be36690 100755 --- a/apt-cacher2 +++ b/apt-cacher2 @@ -441,10 +441,6 @@ sub handle_connection { # Decode embedded ascii codes in URL $path =~ s/%([0-9A-Fa-f]{2})/chr(hex($1))/eg; - # tolerate CGI specific junk and two slashes in the beginning - $path =~ s!^/apt-cacher\??/!/!; - $path =~ s!^//!/!; - if ($path =~ m!^http://([^/]+)!) { # Absolute URI # Check host or proxy debug_message("Checking host $1 in absolute URI"); @@ -473,6 +469,11 @@ sub handle_connection { } defined($sock) && $sock->shutdown(2); # Close } + + # tolerate CGI specific junk and multiple slashes in the beginning + $path =~ s!^/apt-cacher\??/!/!; + $path =~ s!^/+!/!; + debug_message("Resolved request is $path"); # Now parse the path Mark -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org