Open stokito opened 1 year ago
@ethanaobrien Want to look into this? How hard would it be to add?
A simplest read only would be:
DAV: 1,2,3
and Allow: PROPFIND, GET
<?xml version="1.0" encoding="UTF-8"?>
<D:multistatus xmlns:D="DAV:">
<D:response>
<D:href>/dav/Some%20Folder/</D:href>
<D:propstat>
<D:prop>
<D:resourcetype>
<D:collection/>
</D:resourcetype>
<D:getlastmodified>Wed, 08 Mar 2023 12:45:54 GMT</D:getlastmodified>
</D:prop>
<D:status>HTTP/1.1 200 OK</D:status>
</D:propstat>
</D:response>
<D:response>
<D:href>/dav/README.txt</D:href>
<D:propstat>
<D:prop>
<D:resourcetype></D:resourcetype>
<D:getcontentlength>64</D:getcontentlength>
<D:getcontenttype>text/plain</D:getcontenttype>
<D:getetag>"174a620a4078606440"</D:getetag>
<D:getlastmodified>Wed, 08 Mar 2023 12:45:54 GMT</D:getlastmodified>
</D:prop>
<D:status>HTTP/1.1 200 OK</D:status>
</D:propstat>
</D:response>
</D:multistatus>
So here we have a folder Some Folder
but it's href e.g. path of URL is /dav/Some%20Folder/
and space was URL escaped to %20
.
We know that this is a folder because it has <D:resourcetype> <D:collection/> </D:resourcetype>
.
Next we have a README.txt
file with href /dav/README.txt
. It has <D:resourcetype></D:resourcetype>
e.g. empty.
The server already has a directory listing. But with just few small changes it may also support WebDAV file transfer protocol. This will allow to mount a folder or use many other programs to work with files e.g. music players, backup/sync tools. By implementing also LOCK, PUT, DELETE, MKCOL methods the folder can be also be edited but this increases complexity.
With this feature users will easier share files and can have a small personal cloud.
The original 200 OK server also had the feature request https://github.com/kzahel/web-server-chrome/issues/143