Skip Menu |

This queue is for tickets about the HTTP-Daemon CPAN distribution.

Report information
The Basics
Id: 19123
Status: resolved
Priority: 0/
Queue: HTTP-Daemon

People
Owner: Nobody in particular
Requestors: sscott [...] ph.unimelb.edu.au
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: (no value)



Subject: HTTP::Daemon always resolves server hostname from IP
HTTP::Daemon in sub url (aka $self->daemon->url) always resolves the IP to a hostname, even if the IP was specified. if (!$addr || $addr eq INADDR_ANY) { require Sys::Hostname; $url .= lc Sys::Hostname::hostname(); } else { $url .= gethostbyaddr($addr, AF_INET) || inet_ntoa($addr); } This is a problem because the server may be having the ports forwarded to it from a firewall, ie the external address of the server may not be the correct address for the clients to connect to. This causes problems for instance in ->redirect if relative paths are specified. It is possible to work around the problem by either specifying full paths in redirects or by setting the server hostname to be the IP of the external interface. It would be better if HTTP::Daemon could simply make a check for a config flag, before executing the block that resolves the hostname. Or it could simply use whatever address is specified, if one has been manually specified, not performing the lookup. It seems safer that the default should be to not do the lookup, and that reverse lookups should require a config flag.
From: sscott
Can you please obfuscate or remove my email in the bug report? I didn't expect that it would be printed as is for any bot to spam.
From: sscott
Show quoted text
> This causes problems for instance in ->redirect if relative paths are > specified. It is possible to work around the problem by either > specifying full paths in redirects or by setting the server hostname to > be the IP of the external interface. >
By the way, the hostname hack (by which i mean the altering the system-wide hostname) is not a particularly good idea, some other services may open themselves up in ways they wouldn't normally, eg X appears to automatically authenticate connections on any IPs it can resolve your hostname to ... at least it does on slackware. :)