commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Dever" <>
Subject RE: [HttpClient][Request] Ability to debranch some logic
Date Fri, 02 Aug 2002 21:40:47 GMT
Hey Vincent,

I'm not sure about dIon's Latka tags, but you've certainly touched on some
nasty code in httpclient.  I had a closer look at your previous comment
about httpclient going infinite in a given situation.  The
HttpMethodBase.execute method contains 150 lines of forwarding, redirecting,
authenticating logic in a for(;;) loop.  There is a little note in comments
too: //this method is too big.  I'd say execute is in need of refactoring.

There are some other limitations in there too, such as redirecting to
another host or port, the infinite loop problem and the unavailable
unauthorized status codes.

I'm working on refactoring it now, but its pretty sensitive.

-----Original Message-----
From: Vincent Massol []
Sent: Friday, August 02, 2002 3:32 PM
To: 'Jakarta Commons Developers List'
Subject: RE: [HttpClient][Request] Ability to debranch some logic


Thanks. I am probably blind but I can't find an example of any 401 test
in the URL you provided (authentication). I can test all response codes
fine with HttpClient except 401, hence my initial email.

Here is the HttpClient code that is involved (I think) :

            if (HttpStatus.SC_UNAUTHORIZED == statusCode) {
                Header wwwauth = getResponseHeader("WWW-Authenticate");
                if (null != wwwauth) {
[some code to send another request to authenticate]

I haven't followed closely the code but I don't see any code to debranch
this. For redirects it works fine as the code is :

            } else if (HttpStatus.SC_MOVED_TEMPORARILY == statusCode ||
               HttpStatus.SC_MOVED_PERMANENTLY == statusCode ||
               HttpStatus.SC_TEMPORARY_REDIRECT == statusCode) {
                if (getFollowRedirects()) {

thus getFollowRedirects() returns false is HttpClient is set not to
follow redirects.

As I don't follow all the code for authentication, can someone from
HttpClient tell me if it is possible to test a 401 response coming from
the server without HttpClient intercepting it ?


> -----Original Message-----
> From: []
> Sent: 02 August 2002 04:10
> To: Jakarta Commons Developers List
> Subject: RE: [HttpClient][Request] Ability to debranch some logic
> "Vincent Massol" <> wrote on 08/02/2002 12:36:55 AM:
> > Hi dIon,
> >
> > No I haven't. Where should I look at exactly ? Are you saying that
> > are able to write Latka test for 401 HTTP responses ?
> Should be able to.....
> here's a sample....
> commons/latka/src/jelly/latka.jelly?rev=1.19&content-
> type=text/vnd.viewcvs-markup
> It all relies on httpclient under the covers though...........
> >
> > Thanks
> > -Vincent
> --
> dIon Gillard, Multitask Consulting
> Work:
> Developers:

To unsubscribe, e-mail:
For additional commands, e-mail:

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message