You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-dev@jakarta.apache.org by ib...@apache.org on 2004/01/21 10:39:23 UTC

cvs commit: jakarta-slide/webdavclient/clientlib/src/java/org/apache/webdav/lib WebdavResource.java

ib          2004/01/21 01:39:23

  Modified:    webdavclient/clientlib/src/java/org/apache/webdav/lib
                        WebdavResource.java
  Log:
  Workaround for buggy servers: Accept 200 as response to a PROPFIND request.
  
  Revision  Changes    Path
  1.3       +12 -6     jakarta-slide/webdavclient/clientlib/src/java/org/apache/webdav/lib/WebdavResource.java
  
  Index: WebdavResource.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/webdavclient/clientlib/src/java/org/apache/webdav/lib/WebdavResource.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- WebdavResource.java	19 Jan 2004 09:30:01 -0000	1.2
  +++ WebdavResource.java	21 Jan 2004 09:39:23 -0000	1.3
  @@ -3097,7 +3097,9 @@
           if (thisResource == true) {
               setStatusCode(status);
           }
  -        if (status != HttpStatus.SC_MULTI_STATUS) {
  +        // Also accept OK sent by buggy servers.
  +        if (status != HttpStatus.SC_MULTI_STATUS
  +            && status != HttpStatus.SC_OK) {
               HttpException ex = new HttpException();
               ex.setReasonCode(status);
               throw ex;
  @@ -3166,7 +3168,9 @@
               // Set the status code.
               setStatusCode(method.getStatusLine().getStatusCode());
           }
  -        if (status != HttpStatus.SC_MULTI_STATUS) {
  +        // Also accept OK sent by buggy servers.
  +        if (status != HttpStatus.SC_MULTI_STATUS
  +            && status != HttpStatus.SC_OK) {
               HttpException ex = new HttpException();
               ex.setReasonCode(status);
               throw ex;
  @@ -3255,7 +3259,9 @@
                                                      properties.elements());
           int status = client.executeMethod(method);
   
  -        if (status != HttpStatus.SC_MULTI_STATUS) {
  +        // Also accept OK sent by buggy servers.
  +        if (status != HttpStatus.SC_MULTI_STATUS
  +            && status != HttpStatus.SC_OK) {
               HttpException ex = new HttpException();
               ex.setReasonCode(status);
               throw ex;
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: slide-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-dev-help@jakarta.apache.org