Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebDAV #130

Open
stokito opened this issue Mar 18, 2023 · 2 comments
Open

WebDAV #130

stokito opened this issue Mar 18, 2023 · 2 comments
Assignees

Comments

@stokito
Copy link
Contributor

stokito commented Mar 18, 2023

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 kzahel/web-server-chrome#143

@terreng
Copy link
Owner

terreng commented Mar 18, 2023

@ethanaobrien Want to look into this? How hard would it be to add?

@stokito
Copy link
Contributor Author

stokito commented Mar 18, 2023

A simplest read only would be:

  1. Handle OPTIONS and return two headers DAV: 1,2,3 and Allow: PROPFIND, GET
  2. Handle PROPFIND and return directory listing but in XML form like:
<?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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants