in reply to Should LWP warn about wrong Content-Length?

Doesn't it already do that?

'GET' implies very old version of LWP

http://cpansearch.perl.org/src/GAAS/libwww-perl-6.05/lib/LWP/Protocol/http.pm

warn "Content-Length header value was wrong, fixed"; warn "Content-Length set when there is no content, fixed";

Replies are listed 'Best First'.
Re^2: Should LWP warn about wrong Content-Length? (it does)
by vsespb (Chaplain) on May 30, 2013 at 08:42 UTC
    warn "Content-Length header value was wrong, fixed"; warn "Content-Length set when there is no content, fixed";
    I saw this code, but looks like it's request headers, not response header. Besides in my example, there is no warnings.
    'GET' implies very old version of LWP
    GET just uses last version of LWP, installed on the box. No?
    Also I actually experience this behaviour in my normal code, without GET tool.

      I saw this code, but looks like it's request headers, not response header. Besides in my example, there is no warnings.

      Well :) now you know your next course of action, submit a bug report if you think its important

      OTOH, a warning seems like a clumsy way to communicate this -- sure its better than nothing, but not by much

      GET just uses last version of LWP, installed on the box. No?

      I think so yeah, but its not installed by default anymore ... which version do you have, the latest available?

        warning seems like a clumsy way to communicate this
        For request it's probably OK. Because wrong Content-Length in request is must be programmer mistake. But wrong Content-Length in response is something programmer cannot control.

        For response there are existing ways to report problem, like: HTTP 500 with 'Client-Warning'=> 'Internal response' header. Or 'X-Died' header (without changing http response code, i.e. it can be 200 OK)

        which version do you have
        perl -MLWP -e 'print LWP->VERSION' 6.05