--- HttpMethodBase.old 2002-08-19 11:13:38.000000000 +0200 +++ HttpMethodBase.java 2002-08-21 17:55:13.000000000 +0200 @@ -321,6 +321,24 @@ } /** + * Whether or not I should automatically process responses where + * authentication is required (status code 401, etc.) + * @return true if I will automatically process authentications + */ + public boolean getDoAuthentication() { + return this.doAuthentication; + } + + /** + * Set whether or not I should automatically process responses where + * authentication is required (status code 401, etc.) + */ + public void setDoAuthentication(boolean doAuthentication) { + this.doAuthentication = doAuthentication; + } + + + /** * Set my query string. * @param queryString the query string */ @@ -749,9 +767,13 @@ switch(statusCode){ case HttpStatus.SC_UNAUTHORIZED: case HttpStatus.SC_PROXY_AUTHENTICATION_REQUIRED: - // process authentication response - boolean authenticated = processAuthenticationResponse(state, conn); - if (authenticated){ + if (doAuthentication) { + // process authentication response + boolean authenticated = processAuthenticationResponse(state, conn); + if (authenticated){ + return statusCode; + } + } else { return statusCode; } break; @@ -1526,6 +1548,7 @@ path = null; followRedirects = false; + doAuthentication = true; queryString = null; requestHeaders.clear(); responseHeaders.clear(); @@ -1682,6 +1705,8 @@ private String path = null; /** Whether or not I should automatically follow redirects. */ private boolean followRedirects = false; + /** Whether or not I should automatically processs authentication. */ + private boolean doAuthentication = true; /** My query string, if any. */ private String queryString = null; /** My request headers, if any. */