cryptomator / webdav-nio-adapter

Jackrabbit-based servlets running on embedded Jetty to serve a directory specified by a java.nio.file.Path
GNU Affero General Public License v3.0
12 stars 8 forks source link

Allow PROPFIND on / #11

Closed overheadhunter closed 6 years ago

overheadhunter commented 6 years ago

From @overheadhunter on April 15, 2016 15:59

Linux Mint's WebDAV client makes a PROPFIND request to / during mount.

2016-04-15 17:53:51,300 DEBUG [Server:506] REQUEST on HttpChannelOverHttp@4fb693e{r=4,c=false,a=DISPATCHED,uri=/}
OPTIONS //localhost:37206/
Host: localhost:37206
Accept-Encoding: gzip, deflate
Accept-Language: de-de, de;q=0.9
Connection: keep-alive
User-Agent: gvfs/1.20.3

2016-04-15 17:53:51,300 DEBUG [Server:520] RESPONSE for / h=true
204 null
Date: Fri, 15 Apr 2016 15:53:51 GMT
DAV: 1, 2
MS-Author-Via: DAV

2016-04-15 17:53:51,343 DEBUG [Server:506] REQUEST on HttpChannelOverHttp@2019fe26{r=1,c=false,a=DISPATCHED,uri=/}
PROPFIND //localhost:37206/
Host: localhost:37206
Depth: 0
Content-Type: application/xml
Accept-Encoding: gzip, deflate
Accept-Language: de-de, de;q=0.9
Connection: keep-alive
Content-Length: 124
User-Agent: gvfs/1.20.3

2016-04-15 17:53:51,354 DEBUG [Server:520] RESPONSE for / h=true
501 Method PROPFIND is not defined in RFC 2068 and is not supported by the Servlet API 
Date: Fri, 15 Apr 2016 15:53:51 GMT
Cache-Control: must-revalidate,no-cache,no-store
Content-Type: text/html;charset=iso-8859-1
Content-Length: 390

Copied from original issue: cryptomator/cryptomator#235

overheadhunter commented 6 years ago

From @FZachlod on March 29, 2017 11:19

Any progress on this? Cannot connect to the Webdav Server with any client I tried in Linux... mount.davfs fails, fusedav fails, cadaver fails. I assume the clients are right to expect the server to be able to handle PROPFIND properly.

overheadhunter commented 6 years ago

@FZachlod mounting should not fail, you seem to have some other problem, maybe some software that intercepts network traffic? The aforementioned PROPFIND capability is only an enhancement, as it did not prevent mounting, it merely looked stupid in the logfile.

overheadhunter commented 6 years ago

From @FZachlod on March 29, 2017 11:57

fusedav -D http://localhost:8081/ /mnt/test/

getattr(/)
CGET: /
STAT-CACHE-MISS
PROPFIND failed: 501 Method PROPFIND is not defined in RFC 2068 and is not supported by the Servlet API
getattr(/)
CGET: /
STAT-CACHE-MISS
PROPFIND failed: 501 Method PROPFIND is not defined in RFC 2068 and is not supported by the Servlet API
getattr(/)
CGET: /
STAT-CACHE-MISS
PROPFIND failed: 501 Method PROPFIND is not defined in RFC 2068 and is not supported by the Servlet API
getattr(/)
CGET: /
STAT-CACHE-MISS
PROPFIND failed: 501 Method PROPFIND is not defined in RFC 2068 and is not supported by the Servlet API

on the other side I try:

ls /mnt/test
ls: cannot access /mnt/test: No such file or directory

I can put files with CURL though:

curl -T /etc/rc.local http://localhost:8081/

or

curl -X MKCOL http://localhost:8081/test

but when I try to download them again:

curl http://localhost:8081/rc.local
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 405 HTTP method GET is not supported by this URL</title>
</head>
<body><h2>HTTP ERROR 405</h2>
<p>Problem accessing /rc.local. Reason:
<pre>    HTTP method GET is not supported by this URL</pre></p><hr><a href="http://eclipse.org/jetty">Powered by Jetty:// 9.4.z-SNAPSHOT</a><hr/>

</body>
</html>

I don't know which method the Windows Webdav client uses instead. Seems GET does not work either.

overheadhunter commented 6 years ago

@FZachlod you can't mount localhost:8081, but you'd rather need the full URL, which can be copied from either the UI or is written to the log file ([WebDavServer:121] Servlet available under http://localhost:8080/yQqBS3pivA8F/test)

overheadhunter commented 6 years ago

From @FZachlod on March 29, 2017 12:10

You are right. Funnyly I built from the latest code from the develop branch which seems to not start the server correctly fro some reason. It does not log the [WebDavServer:126] WebDavServlet available under http://localhost:8081/XYZ message just:

2017-03-29 14:04:45,553 INFO [CryptomatorCli:69] Unlocking vault "XYZ" located at /mnt/XYZ 2017-03-29 14:04:47,055 INFO [CryptomatorCli:89] Server started. Press Ctrl+C to terminate.

It seems I cannot access them though. With version 0.2.1 I can mount as expected.

overheadhunter commented 6 years ago

Ok this might be a bug, will put it on our regression testing list. We are currently doing a massive refactoring on the develop branch, that is why it may have a different behaviour.