ramondeklein/nwebdav

Total Commander broken with commit d914594

yar229 opened this issue · 1 comments

after d914594 shows all folders like files

This commit allows proper reporting of invalid properties, but it has another side effect that the WebDAV addon of Total Commander cannot deal with. Before this commit, the properties were reported like this

  <D:response>
    <D:href>http://localhost:11111/</D:href>
    <D:propstat>
      <D:prop>
        <D:creationdate>2017-12-25T23:14:17.732Z</D:creationdate>
        <D:displayname>Test</D:displayname>
        <D:getlastmodified>Sun, 02 Dec 2018 11:16:05 GMT</D:getlastmodified>
        <D:resourcetype>
          <D:collection />
        </D:resourcetype>
        <D:lockdiscovery />
        <D:supportedlock>
          <D:lockentry>
            <D:lockscope>
              <D:exclusive />
            </D:lockscope>
            <D:locktype>
              <D:write />
            </D:locktype>
          </D:lockentry>
          <D:lockentry>
            <D:lockscope>
              <D:shared />
            </D:lockscope>
            <D:locktype>
              <D:write />
            </D:locktype>
          </D:lockentry>
        </D:supportedlock>
        <D:childcount>1</D:childcount>
        <D:isfolder>1</D:isfolder>
        <D:ishidden>0</D:ishidden>
        <D:isstructureddocument>0</D:isstructureddocument>
        <D:hassubs>0</D:hassubs>
        <D:nosubs>0</D:nosubs>
        <D:objectcount>1</D:objectcount>
        <D:reserved>0</D:reserved>
        <D:visiblecount>1</D:visiblecount>
        <Z:Win32CreationTime>Mon, 25 Dec 2017 23:14:17 GMT</Z:Win32CreationTime>
        <Z:Win32LastAccessTime>Sun, 02 Dec 2018 11:16:05 GMT</Z:Win32LastAccessTime>
        <Z:Win32LastModifiedTime>Sun, 02 Dec 2018 11:16:05 GMT</Z:Win32LastModifiedTime>
        <Z:Win32FileAttributes>00000010</Z:Win32FileAttributes>
      </D:prop>
      <D:status>HTTP/1.1 200 OK</D:status>
    </D:propstat>
  </D:response>

After this commit, every property is wrapped in its own <D:prop> tag, like this:

  <D:response>
    <D:href>http://localhost:11111/</D:href>
    <D:propstat>
      <D:prop>
        <D:creationdate>2017-12-25T23:14:17.732Z</D:creationdate>
      </D:prop>
      <D:prop>
        <D:displayname>Test</D:displayname>
      </D:prop>
      <D:prop>
        <D:getlastmodified>Sun, 02 Dec 2018 11:16:05 GMT</D:getlastmodified>
      </D:prop>
      <D:prop>
        <D:resourcetype>
          <D:collection />
        </D:resourcetype>
      </D:prop>
      <D:prop>
        <D:lockdiscovery />
      </D:prop>
      <D:prop>
        <D:supportedlock>
          <D:lockentry>
            <D:lockscope>
              <D:exclusive />
            </D:lockscope>
            <D:locktype>
              <D:write />
            </D:locktype>
          </D:lockentry>
          <D:lockentry>
            <D:lockscope>
              <D:shared />
            </D:lockscope>
            <D:locktype>
              <D:write />
            </D:locktype>
          </D:lockentry>
        </D:supportedlock>
      </D:prop>
      <D:prop>
        <D:childcount>1</D:childcount>
      </D:prop>
      <D:prop>
        <D:isfolder>1</D:isfolder>
      </D:prop>
      <D:prop>
        <D:ishidden>0</D:ishidden>
      </D:prop>
      <D:prop>
        <D:isstructureddocument>0</D:isstructureddocument>
      </D:prop>
      <D:prop>
        <D:hassubs>0</D:hassubs>
      </D:prop>
      <D:prop>
        <D:nosubs>0</D:nosubs>
      </D:prop>
      <D:prop>
        <D:objectcount>1</D:objectcount>
      </D:prop>
      <D:prop>
        <D:reserved>0</D:reserved>
      </D:prop>
      <D:prop>
        <D:visiblecount>1</D:visiblecount>
      </D:prop>
      <D:prop>
        <Z:Win32CreationTime>Mon, 25 Dec 2017 23:14:17 GMT</Z:Win32CreationTime>
      </D:prop>
      <D:prop>
        <Z:Win32LastAccessTime>Sun, 02 Dec 2018 11:16:05 GMT</Z:Win32LastAccessTime>
      </D:prop>
      <D:prop>
        <Z:Win32LastModifiedTime>Sun, 02 Dec 2018 11:16:05 GMT</Z:Win32LastModifiedTime>
      </D:prop>
      <D:prop>
        <Z:Win32FileAttributes>00000010</Z:Win32FileAttributes>
      </D:prop>
      <D:status>HTTP/1.1 200 OK</D:status>
    </D:propstat>
  </D:response>

It seems its invalid to have more than 1 prop tag inside a propstat tag (although this is not 100% clear from the specification). Property, with status 200, can be put in a single tag which is more efficient and also fixes this bug.

So in commit 3e97f4c, I have put all OK properties in a single tag again, which should fix this issue.