in reply to Re: Undeleteable header in WWW::Mechanize
in thread Undeleteable header in WWW::Mechanize

It took some searching, but I found that it's added by Net::HTTP at the request of LWP::Protocol::http. You can change the default by using

@LWP::Protocol::http::EXTRA_SOCK_OPTS = ( SendTE => 0, );

You can use local to limit the scope of the change if you desire.

{ local @LWP::Protocol::http::EXTRA_SOCK_OPTS = ( SendTE => 0, ); ...do the request... }

Untested.

Replies are listed 'Best First'.
Re^3: Undeleteable header in WWW::Mechanize
by javahater (Initiate) on Dec 20, 2007 at 21:08 UTC
    works like a charm.
    I feel pretty stupid now, that'd have been the last place I would have looked. That also fixed an issue with the Connection header being set to "keep-alive, close" since it's possible to set a proper Keep-Alive header like this:
    local @LWP::Protocol::http::EXTRA_SOCK_OPTS = ( SendTE => 0, KeepAlive => 1 );

    Thank You!