Uploaded image for project: 'Subversion'
  1. Subversion
  2. SVN-2896

creation of a lock-empty resource should return 201, not 200

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Critical
    • Resolution: Unresolved
    • Affects Version/s: 1.4.x
    • Fix Version/s: unscheduled
    • Component/s: mod_dav_svn
    • Labels:
      None
    • Environment:

      Linux

      Description

      Creation of a lock-empty resource on a subversion autoversioning DAV server
      returns a 200 response, but RFC 4918 requires that the server MUST return a 201
      response.  See http://greenbytes.de/tech/webdav/rfc4918.html#lock-unmapped-urls
      
      Here is a sample interaction using cadaver:
      
      dav:/svn/autov/tim/test/> ls
      Listing collection `/svn/autov/tim/test/': collection is empty.
      dav:/svn/autov/tim/test/> set debug http
      dav:/svn/autov/tim/test/> lock unmapped
      Running pre_send hooks
      Sending request headers:
      PROPFIND /svn/autov/tim/test/unmapped HTTP/1.1
      Host: dubstep.brooklynpenguin.com
      User-Agent: cadaver/0.22.5 neon/0.26.4
      Connection: TE
      TE: trailers
      Depth: 0
      Content-Length: 288
      Content-Type: application/xml
      Authorization:
      xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
      
      Sending request-line and headers:
      Sending request body:
      Request sent; retry is 1.
      Aborted request (-3): Could not read status line
      Persistent connection timed out, retrying.
      Sending request-line and headers:
      Connecting to 216.254.75.249
      Sending request body:
      Request sent; retry is 0.
      [status-line] < HTTP/1.1 404 Not Found
      [hdr] Date: Tue, 28 Aug 2007 17:27:42 GMT
      Header Name: [date], Value: [Tue, 28 Aug 2007 17:27:42 GMT]
      [hdr] Server: Apache/2.2.3 (Debian) DAV/2 SVN/1.4.2 mod_ssl/2.2.3 OpenSSL/0.9.8c
      Header Name: [server], Value: [Apache/2.2.3 (Debian) DAV/2 SVN/1.4.2
      mod_ssl/2.2.3 OpenSSL/0.9.8c]
      [hdr] Vary: Accept-Encoding
      Header Name: [vary], Value: [Accept-Encoding]
      [hdr] Content-Length: 363
      Header Name: [content-length], Value: [363]
      [hdr] Content-Type: text/html; charset=iso-8859-1
      Header Name: [content-type], Value: [text/html; charset=iso-8859-1]
      [hdr] 
      End of headers.
      Reading 363 bytes of response body.
      Got 363 bytes.
      Running post_send hooks
      Request ends, status 404 class 4xx, error line:
      404 Not Found
      Running destroy hooks.
      Request ends.
      Locking `unmapped':req: Closing connection for non-idempotent request.
      Running pre_send hooks
      Sending request headers:
      LOCK /svn/autov/tim/test/unmapped HTTP/1.1
      Host: dubstep.brooklynpenguin.com
      User-Agent: cadaver/0.22.5 neon/0.26.4
      Connection: TE
      TE: trailers
      Content-Length: 141
      Content-Type: application/xml
      Depth: infinity
      Authorization:
      xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
      
      Sending request-line and headers:
      Connecting to 216.254.75.249
      Sending request body:
      Request sent; retry is 0.
      [status-line] < HTTP/1.1 200 OK
      [hdr] Date: Tue, 28 Aug 2007 17:27:42 GMT
      Header Name: [date], Value: [Tue, 28 Aug 2007 17:27:42 GMT]
      [hdr] Server: Apache/2.2.3 (Debian) DAV/2 SVN/1.4.2 mod_ssl/2.2.3 OpenSSL/0.9.8c
      Header Name: [server], Value: [Apache/2.2.3 (Debian) DAV/2 SVN/1.4.2
      mod_ssl/2.2.3 OpenSSL/0.9.8c]
      [hdr] Authentication-Info: rspauth="0141845fa18ac5b9e6e941d6647990e8",
      cnonce="4acad8a6c56e3e94a86025d7ac586e6b", nc=00000005, qop=auth
      Header Name: [authentication-info], Value:
      [rspauth="0141845fa18ac5b9e6e941d6647990e8",
      cnonce="4acad8a6c56e3e94a86025d7ac586e6b", nc=00000005, qop=auth]
      [hdr] X-SVN-Creation-Date: 2007-08-28T17:27:42.391812Z
      Header Name: [x-svn-creation-date], Value: [2007-08-28T17:27:42.391812Z]
      [hdr] X-SVN-Lock-Owner: tim
      Header Name: [x-svn-lock-owner], Value: [tim]
      [hdr] Lock-Token: <opaquelocktoken:832fd38f-35c5-44c0-9512-73ecbb0486ae>
      Header Name: [lock-token], Value:
      [<opaquelocktoken:832fd38f-35c5-44c0-9512-73ecbb0486ae>]
      [hdr] Vary: User-Agent,Accept-Encoding
      Header Name: [vary], Value: [User-Agent,Accept-Encoding]
      [hdr] Content-Length: 378
      Header Name: [content-length], Value: [378]
      [hdr] Content-Type: text/xml; charset="utf-8"
      Header Name: [content-type], Value: [text/xml; charset="utf-8"]
      [hdr] 
      End of headers.
      Reading 378 bytes of response body.
      Got 378 bytes.
      Running post_send hooks
      Running destroy hooks.
      Request ends.
       succeeded.
      dav:/svn/autov/tim/test/> 
      
      This currently causes problem with davfs.  Since a 200 response is returned, and
      a subsequent HEAD request returns 200 (whereas old locknull behavior would
      return 404), Davfs assumes that a third-party PUT request slipped in.  Davfs
      then aborts whatever it planned to do with the lock-empty resource.  If a 201
      response was returned first, then davfs would know that the LOCK itself created
      the resource.
      
      I posted the bug to the dev mailing list:
      http://subversion.tigris.org/servlets/ReadMsg?list=dev&msgNo=129529
      
      Julian Reschke is my bug buddy:
      http://subversion.tigris.org/servlets/ReadMsg?list=dev&&msgNo=129530
      
      Thanks!
      
      -Tim
      

      http://subversion.tigris.org/servlets/ReadMsg?list=dev&msgNo=129529

      Original issue reported by tolsen718

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              subversion-importer Subversion Importer
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated: