How do DAV-Redirects work?

234 views
Skip to first unread message

None

unread,
May 9, 2014, 5:29:32 AM5/9/14
to sabredav...@googlegroups.com
Hi all,

currently i'm facing the problem with my own SabreDav Server to provide access to files where the path decides where the file is hosted
e.g. a bunch of users is hosted on Server1, the others are hosted on Server2
or data files for physical experiments are stored by creation date on different servers
so intuitively this sound like a case for plain simple http-redirect

my first test was to just cause a 302 redirect and setting the location where the client should access the file - both servers using my SabreDAV implementation
and more or less just test if the requested file is locally available
well, it doesnt really work on my ubuntu 13.10 gvfs client - it seems it just doesnt know how to handle the response, so i get an invalid response error and the client aborts

googling for this topic doesnt really reveal the solution for this, but only RF4437 which i'm not sure i understand what its all about
so my questions here are not specific to my exact problem but to the general idea of how WebDAV is supposed handle redirects
Questions:
HTTP redirect:
Is a 301/302/... HTTP Redirect allowed or are most clients able to handle this on methods NOT (POST or PUT)?
Or on which methods are most clients able to handle HTTP redirects? anyone has experience on this?
Shall there be any content body on a HTTP redirect?
Which clients are known to handle such redirects? open source would be interesting so i could investigate my implementation better

Regarding RFC4437:
I noticed that SabreDAV had a plugin for this in Version 1.3.0. see https://code.google.com/p/sabredav/source/browse/lib/Sabre/DAV/Redirect/Plugin.php?name=redirect
I'm not sure if i get the purpose of the RFC right, but is it meant to have somthing like symbolic links (MKREDIRECTREF) on (remote) servers?
And if a resource is queried which resides somewhere else a DAV response (some kind of HTML/XML) shall be returned - so no HTTP Redirect, right?
Which clients are known to handle such redirects? open source would be great

Regarding SabreDAV:
Is there any out of the box version (current) 1.8.9 which has support for redirects? maybe i miss something here.
Why/Has the redirect plugin been droped?
And what would be the options to get redirect support on clients for arbitrary file/directory resources located anywhere?

thx for your help
N

Evert Pot

unread,
May 11, 2014, 11:41:12 PM5/11/14
to sabredav...@googlegroups.com
Hi None,


That's a lot of research, but I have some bad news.

I don't believe most clients will follow redirects on webdav clients. I haven't done extensive testing, but that's my theory.
I'm not a 100% confident on this, but the easiest way to test this is to setup a standard server and use mod_rewrite or equivalent to redirect for example just one file. (make sure you do this only upon GET). The one exception: I have a feeling that the Gnome client may implement it, but also not fully sure.

As for the redirects plugin (rfc4437), that never made it into a release. You're looking at a feature branch that never got merged in, not a stable branch.
There wasn't any demand for it, and I lost interest so I didn't bother completing it.

If you find a few clients that do support redirects, and it's worth it for you to go down the path of implementing it into sabredav, I'd be happy to take a second look at that plugin.

Cheers,
Evert

None

unread,
May 15, 2014, 3:05:21 PM5/15/14
to sabredav...@googlegroups.com
It seems you are very right with the bad news.
I had a look at the source of cadaver and davfs which both use neon under the hood.
Altough neon would support redirects, one has to handle them yourself by e.g. grab the location header and resend request again.
Anyway - redirects are not supported by cadaver or davfs.

I also got gvfs working with my implementation but only for HEAD and GET requests. So there is something working.
But since redirects are practically not supported by the clients i will write my own local java http proxy which handles my redirects
and need to be installed on the local hosts which want this feature of my sabredav redirect plugin.
This way one can also mount a windows dav drive using a connection to localhost and use my prefered way of accessing
the files needed on all servers.

thx anyway
Reply all
Reply to author
Forward
0 new messages