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);