Subject: | Host header does not contain port |
Hi,
the RPC::XML::Client module does not include port in the Host: request
header, i.e. for a request to http://myserver:8080/service it produces
Host: myserver
instead of
Host: myserver:8080
this causes trouble with server side applications which use only the
Host header to distinguish virtual hosts on different ports.
The following patch solves the issue:
--- Client.pm.orig 2011-04-15 12:10:32.000000000 +0200
+++ Client.pm 2011-04-15 12:05:20.000000000 +0200
@@ -240,7 +240,7 @@
# Start by setting up the request-clone for using in this instance
$reqclone = $self->request->clone;
- $reqclone->header(Host => URI->new($reqclone->uri)->host);
+ $reqclone->header(Host => URI->new($reqclone->uri)->host_port);
$can_compress = $self->compress; # Avoid making 4+ calls to the
method
if ($self->compress_requests and $can_compress and
$req->length >= $self->compress_thresh)