Skip Menu |

This queue is for tickets about the RPC-XML CPAN distribution.

Report information
The Basics
Id: 67486
Status: resolved
Priority: 0/
Queue: RPC-XML

People
Owner: rjray [...] blackperl.com
Requestors: makovick [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: (no value)
Fixed in: 0.77



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)
I recently took a patch that changed some behavior around the Host header, so I'll have to see that this doesn't break that work, and vice-versa. But this should be in 0.77. -- Randy J. Ray rjray@blackperl.com randy.j.ray@gmail.com
On Tue Aug 23 13:03:59 2011, RJRAY wrote: Show quoted text
> I recently took a patch that changed some behavior around the Host > header, so I'll have to see that this doesn't break that work, and > vice-versa. But this should be in 0.77.
I had a problem with this a few days ago. I simply made this simple change in Client.pm: if (! $reqclone->header('Host')) { - $reqclone->header(Host => URI->new($reqclone->uri)->host); + $reqclone->header(Host => URI->new($reqclone->uri)->host_port);
On Wed Aug 22 13:29:44 2012, HANK wrote: Show quoted text
> On Tue Aug 23 13:03:59 2011, RJRAY wrote:
> > I recently took a patch that changed some behavior around the Host > > header, so I'll have to see that this doesn't break that work, and > > vice-versa. But this should be in 0.77.
> > I had a problem with this a few days ago. > > I simply made this simple change in Client.pm: > > if (! $reqclone->header('Host')) { > - $reqclone->header(Host => URI->new($reqclone->uri)->host); > + $reqclone->header(Host => URI->new($reqclone->uri)->host_port);
Yeah, that's what I have in the git repo currently. I really must free up some time to at least release what I currently have as 0.77, even if it isn't what I initially wanted 0.77 to be... this fix is a year old! Randy -- Randy J. Ray rjray@blackperl.com randy.j.ray@gmail.com