jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Javier Godoy (JIRA)" <j...@apache.org>
Subject [jira] Created: (JCR-2731) LockMethod.getResponseAsLockDiscovery() fails when status==201
Date Sat, 28 Aug 2010 19:58:54 GMT
LockMethod.getResponseAsLockDiscovery() fails when status==201 

                 Key: JCR-2731
                 URL: https://issues.apache.org/jira/browse/JCR-2731
             Project: Jackrabbit Content Repository
          Issue Type: Bug
          Components: jackrabbit-webdav
    Affects Versions: 2.2.0
            Reporter: Javier Godoy

RFC 4918 Section 9.10.6 specifies that 201 is a valid response code for LOCK: "201 (Created)
- The LOCK request was to an unmapped URL, the request succeeded and resulted in the creation
of a new resource, and the value of the DAV:lockdiscovery property is included in the response

However, LockMethod.getResponseAsLockDiscovery() would fail in that scenario. 
    org.apache.jackrabbit.webdav.DavException: Created
	 at org.apache.jackrabbit.webdav.client.methods.DavMethodBase.getResponseException(DavMethodBase.java:164)
	 at org.apache.jackrabbit.webdav.client.methods.LockMethod.getResponseAsLockDiscovery(LockMethod.java:119)

The reason is in LockMethod:175 
      return statusCode == DavServletResponse.SC_OK;

Should be: 
      return statusCode == DavServletResponse.SC_OK
             || statusCode ==DavServletResponse.SC_CREATED;

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message