[Httpunit-commit] CVS: httpunit/src/com/meterware/httpunit WebClient.java,1.36,1.37
Brought to you by:
russgold
|
From: Russell G. <rus...@us...> - 2002-10-08 17:55:52
|
Update of /cvsroot/httpunit/httpunit/src/com/meterware/httpunit
In directory usw-pr-cvs1:/tmp/cvs-serv988/src/com/meterware/httpunit
Modified Files:
WebClient.java
Log Message:
don't throw authorization required exception if disabled
Index: WebClient.java
===================================================================
RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/WebClient.java,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -r1.36 -r1.37
--- WebClient.java 4 Oct 2002 15:19:25 -0000 1.36
+++ WebClient.java 8 Oct 2002 17:55:49 -0000 1.37
@@ -506,16 +506,16 @@
* Examines the headers in the response and throws an exception if appropriate.
**/
private void validateHeaders( WebResponse response ) throws HttpException, IOException {
+ if (!getExceptionsThrownOnErrorStatus()) return;
+
if (response.getHeaderField( "WWW-Authenticate" ) != null) {
throw new AuthorizationRequiredException( response.getHeaderField( "WWW-Authenticate" ) );
- } else if (getExceptionsThrownOnErrorStatus()) {
- if (response.getResponseCode() == HttpURLConnection.HTTP_INTERNAL_ERROR) {
- throw new HttpInternalErrorException( response.getURL() );
- } else if (response.getResponseCode() == HttpURLConnection.HTTP_NOT_FOUND) {
- throw new HttpNotFoundException( response.getResponseMessage(), response.getURL() );
- } else if (response.getResponseCode() >= HttpURLConnection.HTTP_BAD_REQUEST) {
- throw new HttpException( response.getResponseCode(), response.getResponseMessage(), response.getURL() );
- }
+ } else if (response.getResponseCode() == HttpURLConnection.HTTP_INTERNAL_ERROR) {
+ throw new HttpInternalErrorException( response.getURL() );
+ } else if (response.getResponseCode() == HttpURLConnection.HTTP_NOT_FOUND) {
+ throw new HttpNotFoundException( response.getResponseMessage(), response.getURL() );
+ } else if (response.getResponseCode() >= HttpURLConnection.HTTP_BAD_REQUEST) {
+ throw new HttpException( response.getResponseCode(), response.getResponseMessage(), response.getURL() );
}
}
|