in reply to Re^2: LWP::UserAgent adding unwanted TE header
in thread LWP::UserAgent adding unwanted TE header

Uhm, no. It's not a server header (it's good to know where an RFC is, but to read it actually is far better :-) - it's a client header, and yes, the header is added by LWP because the request is HTTP/1.1. The server header would be Transfer-encoding, it would seem.

The deflate,gzip value gets added if the Zlib library is installed. I can't see that this is somehow cofigurable for now, it's buried in LWP/Protocol/http (in _new_socket):

local($^W) = 0; # IO::Socket::INET can be noisy my $sock = $self->socket_class->new(PeerAddr => $host, PeerPort => $port, Proto => 'tcp', Timeout => $timeout, KeepAlive => !!$conn_cache, SendTE => 1, $self->_extra_sock_opts($host, + $port), );
Setting SendTE to 0 disables TE headers. The above config pseudo hash is passed to Net::HTTP->new it seems. If you get at the NET::HTTP object used by LWP::UserAgent, maybe you can disable sending TE headers..

--shmem

_($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                              /\_¯/(q    /
----------------------------  \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}

Replies are listed 'Best First'.
Re^4: LWP::UserAgent adding unwanted TE header
by Anonymous Monk on Jul 05, 2006 at 22:32 UTC
    Thanks, editting SendTE to 0 manually in LWP/Protocol/http gets rid of the TE header for now. I will do some more reading and try to work out a more elegant solution. Thanks again!