filestash icon indicating copy to clipboard operation
filestash copied to clipboard

[bug] WebDav mounting fails on Linux

Open a1rotaru opened this issue 1 year ago • 1 comments

Description of the bug

Shares cannot be mounted on Linux (GVFS) using davs://

They either fail with HTTP 404 Not Found (when publicly open) or HTTP 400 Bad Request (when restricted to specific users).

Step by step instructions to reproduce the bug

  1. Create a public share then try to mount it:
/usr/libexec/gvfsd-dav host=demo.filestash.app ssl=true prefix=/s/webdavbug
dav: setting 'host' to 'demo.filestash.app'
dav: setting 'ssl' to 'true'
dav: setting 'prefix' to '/s/webdavbug'
dav: Added new job source 0x559acab270a0 (GVfsBackendDav)
dav: Queued new job 0x559acab1f2a0 (GVfsJobMount)
dav: + mount
> OPTIONS /s/webdavbug HTTP/1.1
> Soup-Debug-Timestamp: 1678890353
> Soup-Debug: SoupSession 1 (0x559acab13610), SoupMessage 1 (0x559acab34100), GSocket 1 (0x559acab0b280)
> Accept-Encoding: gzip, deflate, br
> User-Agent: gvfs/1.50.3
> Accept-Language: en-us, en;q=0.9
> Connection: Keep-Alive
> Host: demo.filestash.app
  
< HTTP/1.1 200 OK
< Soup-Debug-Timestamp: 1678890353
< Soup-Debug: SoupMessage 1 (0x559acab34100)
< Server: nginx/1.21.0
< Date: Wed, 15 Mar 2023 14:25:53 GMT
< Content-Length: 0
< Connection: keep-alive
< Allow: OPTIONS, LOCK, PUT, MKCOL
< Dav: 1, 2
< Ms-Author-Via: DAV
  
> PROPFIND /s/webdavbug HTTP/1.1
> Soup-Debug-Timestamp: 1678890353
> Soup-Debug: SoupSession 1 (0x559acab13610), SoupMessage 2 (0x559acab34210), GSocket 1 (0x559acab0b280)
> Accept-Encoding: gzip, deflate, br
> User-Agent: gvfs/1.50.3
> Accept-Language: en-us, en;q=0.9
> Connection: Keep-Alive
> Host: demo.filestash.app
> Content-Type: application/xml
> Content-Length: 146
> Depth: 1
> 
> <?xml version="1.0" encoding="utf-8" ?>
>  <D:propfind xmlns:D="DAV:">
>   <D:prop>
> <D:resourcetype/>
> <D:getcontentlength/>
>   </D:prop>
>  </D:propfind>
  
< HTTP/1.1 404 Not Found
< Soup-Debug-Timestamp: 1678890354
< Soup-Debug: SoupMessage 2 (0x559acab34210)
< Server: nginx/1.21.0
< Date: Wed, 15 Mar 2023 14:25:53 GMT
< Content-Type: text/plain; charset=utf-8
< Content-Length: 9
< Connection: keep-alive
< 
< Not Found
  
dav:  [/s/webdavbug] webdav: 1, collection 0 [res: 0]
dav: send_reply(0x559acab1f2a0), failed=1 (HTTP Error: Not Found)
dav: Mount failed: HTTP Error: Not Found
  1. Create a private ('Only for users' is checked) share then try to mount it:
/usr/libexec/gvfsd-dav host=demo.filestash.app ssl=true user=email[<hash>] prefix=/s/webdavbug
dav: setting 'host' to 'demo.filestash.app'
dav: setting 'ssl' to 'true'
dav: setting 'user' to 'email[<hash>]'
dav: setting 'prefix' to '/s/webdavbug'
dav: Added new job source 0x5592b8fc70a0 (GVfsBackendDav)
dav: Queued new job 0x5592b8fbfaa0 (GVfsJobMount)
dav: + mount
> OPTIONS /s/webdavbug HTTP/1.1
> Soup-Debug-Timestamp: 1678890628
> Soup-Debug: SoupSession 1 (0x5592b8fb3610), SoupMessage 1 (0x5592b8fd4100), GSocket 1 (0x5592b8fab280)
> Accept-Encoding: gzip, deflate, br
> User-Agent: gvfs/1.50.3
> Accept-Language: en-us, en;q=0.9
> Connection: Keep-Alive
> Host: demo.filestash.app
  
dav: send_reply(0x5592b8fbfaa0), failed=1 (HTTP Error: Bad Request)
dav: Mount failed: HTTP Error: Bad Request

Can you replicate that error from the demo?

Yes

Observed behavior

Shares can't be mounted.

Expected behavior

Shares can be mounted.

a1rotaru avatar Mar 15 '23 14:03 a1rotaru

It looks like WebDav works only when share is without credentials. Only for users requires one time code to be taken from e-mail, this doesn't work when mounting as WebDav. The password protected share also requires a password to be entered in the browser window. At least this is what I observed for myself.

MafiaInc avatar Jun 01 '23 05:06 MafiaInc