mholt / caddy-webdav

WebDAV handler module for Caddy
Apache License 2.0
228 stars 24 forks source link

Empty response from Caddy + Webdav #3

Closed nestarz closed 4 years ago

nestarz commented 4 years ago

Hello, I'm using caddy1 + webdav and would like to migrate, but this version of the webdav plugin gives me empty responses, except on the root path where I get the xml right.

Thanks,

Response (on any request except / )

HTTP/1.1 200 OK
Server: Caddy
Date: Fri, 22 May 2020 23:04:21 GMT
Content-Length: 0

Caddyfile

{
    order webdav last
}

:2015 {
    webdav / {
        root ./
    }
}
wader commented 4 years ago

I think the issue might be that path matchers are by default exact. Try to change webdav / to webdav /*.

nestarz commented 4 years ago

It's working ! Thanks a lot !

wader commented 4 years ago

Oh good, was reading your reply, just tested wrong first time?

mholt commented 4 years ago

And you can just get rid of the matcher entirely: https://caddyserver.com/docs/caddyfile/matchers

Matcher tokens are usually optional. If a matcher token is omitted, it is the same as a wildcard matcher (*).

wader commented 4 years ago

@mholt good point!

nestarz commented 4 years ago

@wader Forgot to restart my Caddy server like a rookie 😬 Thanks ! I am trying to use this project to let people mount a folder and share it using the Hyperswarm protocol here https://github.com/nestarz/commoners. Unfortunatly, there is no good Node.js webdav client, so I have to ship a solution with both node and a caddy binary and do tricks to use both ^^, your solution is neat, thanks for doing it

wader commented 4 years ago

@nestarz aha happens to everyone 😄