> This is very likely to be what is happening. You have two options for
> dealing with that:
>
> 1) tell LWP not to add headers from the <head> of the HTML by turning
> off the 'parse_head' attribute:
>
> $ua->parse_head(0);
>
> 2) post-process the request to remove the extra header with something like:
>
> $ua->content_type(($ua->header("Content-Type"))[0]);
These are fine ideas, I'm sorry I didn't find reference to them in the
documentation before I posted here. I did some post processing to work around
this, but the first option fits my needs much better.
> What do you think it should do? We could have the Content-type in the
> <head> always override the content-type in the response headers, but
> that might throw out information and I don't like that. We could have
> LWP not override the header, but then you often loose the extra
> charset parameter that is often what is added in this <head> version
> of the header. The current way might give you surprises, but it does
> not throw away information.
Well, given that the LWP::UserAgent is described as "a class implementing a
simple World-Wide Web user agent in Perl." I think it might be appropriate
to set parse_head to 0 by default, since standards compliant HTTP agents
do not parse the <head> of an HTML document for additional HTTP headers.
However, perhaps LWP::UserAgent gets used mostly by people building
web clients rather than servers, in which case I can see the value of the
extra processing. Thank you for such a prompt and thorough reply, I really
appreciate it. This has been my first real interaction with the free
software community from a position as an active developer, and I must say,
between this list and bugzilla.mozilla.org I am very very impressed.
josh
--
Joshua Vickery
Grinnell College
14-21
Grinnell IA, 50112
[EMAIL PROTECTED]