Kees Cook <[EMAIL PROTECTED]> writes: > I'd like to see this patch added so that HTTP::Daemon::SSL can more > cleanly overload the "url" function without having to totally reimplement > it.
Thanks. Applied. But I made the defaults 80 and "http" :) > Also, could HTTP::Daemon::SSL be made part of the libwww bundle? I don't have a problem with that if its author wants the same. Regards, Gisle > --- libwww-perl-5.802/lib/HTTP/Daemon.pm 2004-04-09 13:21:43.000000000 > -0700 > +++ libwww-perl-5.802-kees/lib/HTTP/Daemon.pm 2004-12-10 10:13:30.000000000 > -0800 > @@ -37,10 +37,22 @@ > } > > > +sub _default_port { > + 443; > +} > + > + > +sub _default_scheme { > + "https"; > +} > + > + > +# Implemented with calls to "_default_port" and "_default_scheme" so that > +# HTTP::Daemon::SSL can overload them and still use this function. > sub url > { > my $self = shift; > - my $url = "http://"; > + my $url = $self->_default_scheme()."://"; > my $addr = $self->sockaddr; > if (!$addr || $addr eq INADDR_ANY) { > require Sys::Hostname; > @@ -50,7 +62,7 @@ > $url .= gethostbyaddr($addr, AF_INET) || inet_ntoa($addr); > } > my $port = $self->sockport; > - $url .= ":$port" if $port != 80; > + $url .= ":$port" if $port != $self->_default_port(); > $url .= "/"; > $url; > }