Skip Menu |

This queue is for tickets about the SOAP-Lite CPAN distribution.

Report information
The Basics
Id: 17320
Status: resolved
Priority: 0/
Queue: SOAP-Lite

People
Owner: Nobody in particular
Requestors: oliver.cook [...] betfair.com
Cc:
AdminCc:

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



Subject: Content-Type: header grows and grows
Under SOAP::Lite 0.66 the Content-Type: HTTP header grows and grows with each call. Enabling 'trace' shows the header being sent as follows: Content-Type: text/xml; charset=utf-8; charset=utf-8; charset=utf-8;... The number of occurrences of "charset=utf-8" increases with each call. I thought this might have been related to the use of HTTP Keep-Alive and the PATCH_HTTP_KEEPALIVE constant, but disabling those doesn't modify this behaviour. The bit of code that introduces this behaviour is in SOAP/Transport/HTTP.pm: if(!$req->content_type){ $req->content_type(join '; ',... I have attached a patch which resolves this for me. I'm not terribly familiar with this module though, so there may be a better way to fix this. Cheers, Ollie
Subject: HTTP.pm.charset.patch
--- /usr/lib/perl5/site_perl/5.8.0/SOAP/Transport/HTTP.pm 2006-01-27 17:22:39.000000000 +0000 +++ /usr/lib/perl5/site_perl/5.8.0/SOAP/Transport/HTTP.pm.orig 2006-01-27 17:21:44.000000000 +0000 @@ -185,8 +185,7 @@ 'charset=' . lc($encoding) : ()); }elsif (!$SOAP::Constants::DO_NOT_USE_CHARSET && $encoding ){ my $tmpType = $self->http_request->headers->header('Content-type'); - my $addition = '; charset=' . lc($encoding); - $self->http_request->content_type($tmpType.$addition) if ($tmpType !~ /$addition/); + $self->http_request->content_type($tmpType.'; charset=' . lc($encoding)); } $self->http_request->content_length($bytelength);
From: oliver.cook [...] betfair.com
The former patch was back-to-front. Please find an updated patch attached. Ollie
--- /usr/lib/perl5/site_perl/5.8.0/SOAP/Transport/HTTP.pm.orig 2006-01-27 17:21:44.000000000 +0000 +++ /usr/lib/perl5/site_perl/5.8.0/SOAP/Transport/HTTP.pm 2006-01-27 17:22:39.000000000 +0000 @@ -185,7 +185,8 @@ 'charset=' . lc($encoding) : ()); }elsif (!$SOAP::Constants::DO_NOT_USE_CHARSET && $encoding ){ my $tmpType = $self->http_request->headers->header('Content-type'); - $self->http_request->content_type($tmpType.'; charset=' . lc($encoding)); + my $addition = '; charset=' . lc($encoding); + $self->http_request->content_type($tmpType.$addition) if ($tmpType !~ /$addition/); } $self->http_request->content_length($bytelength);
AFAIK, this is fixed as of 0.71. Thanks, Martin