Re: Client-Warning header does not work as expected when max redirects set to 0

[email protected] (Victor Efimov) Sun, 11 Nov 2012 00:37:17 +0300
Newsgroups perl.libwww
Message-ID <CAF7QZD7Nd99_4TskvDu-sGd1mJnAXmRUKQfo5fZAiUYwQAm74w@mail.gmail.com>
 Hello.

 A small bug report from me. I have actually 3. here is 1st one.
 (I am not sure where to send bug reports, as there is 3 places with
libwww-perl issue lists)

 In the docs for LWP::UserAgent there is:

> There will still be a response object returned when LWP can't connect to the server specified in the URL or when other failures in protocol handlers occur. These internal responses use the standard HTTP status codes, so the responses can't be differentiated by testing the response status code alone. Error responses that LWP generates internally will have the "Client-Warning" header set to the value "Internal response". If you need to differentiate these internal responses from responses that a remote server actually generates, you need to test this header value.



 However this does not work when you set max_redirects to 0.

 I am getting the following:

> 500 Can't connect to 1.2.3.4:443 (Connection timed out)
> Content-Type: text/plain
> Client-Date: Sat, 03 Nov 2012 14:32:56 GMT
> Client-Warning: Redirect loop detected (max_redirect = 0)


 (Client-Warning overwrited with another message about redirect loop)

 so I think this should be noted in documentation.