Index: java/org/apache/commons/httpclient/HttpMethodBase.java =================================================================== retrieving revision 1.159.2.18 diff -u -r1.159.2.18 HttpMethodBase.java --- java/org/apache/commons/httpclient/HttpMethodBase.java 3 Nov 2003 23:21:08 -0000 1.159.2.18 +++ java/org/apache/commons/httpclient/HttpMethodBase.java 24 Nov 2003 03:00:36 -0000 @@ -2535,17 +2535,16 @@ realmsUsed.add(realm); } - removeRequestHeader(HttpAuthenticator.WWW_AUTH_RESP); - removeRequestHeader(HttpAuthenticator.PROXY_AUTH_RESP); try { - //remove preemptive header and reauthenticate switch (statusCode) { case HttpStatus.SC_UNAUTHORIZED: + removeRequestHeader(HttpAuthenticator.WWW_AUTH_RESP); authenticated = HttpAuthenticator.authenticate( authscheme, this, conn, state); this.realm = authscheme.getRealm(); break; case HttpStatus.SC_PROXY_AUTHENTICATION_REQUIRED: + removeRequestHeader(HttpAuthenticator.PROXY_AUTH_RESP); authenticated = HttpAuthenticator.authenticateProxy( authscheme, this, conn, state); this.proxyRealm = authscheme.getRealm();