root directive appears to ignore {http.auth.user.id}
- Dominant language
- Go
- Stars
- 316
- Forks
- 38
- PR merge metrics
- No merged PRs in 30d
Description
I am trying to setup a multi-user WebDAV configuration.
I have things configured in the Caddyfile as follows:
```
*.example.com {
...
@storage host storage.example.com
handle @storage {
basicauth {
username1
username2
}
root * /path/to/webdav/{http.auth.user.id}
webdav
}
...
}
```
Which is working, but the individual users see the root of the webdav path when they connect (i.e. `/path/to/webdav/`, not `/path/to/webdav/user1` as expected.)
It appears someone else ran into the same issue, as posted here:
https://caddy.community/t/multiple-users-with-different-roots-in-webdav/19502
But they never replied to the debugging suggestions.
As suggested, I turned on debugging and tried the custom X-Auth header. From that, I can see the username from `{http.auth.user.id}` as expected in the response.
Other than that, there don't appear to be any debug messages indicating a problem.
I'm not hugely familiar with go, but I also took a look at the Caddyfile parsing code for this module, and it all looks pretty straightforward and boiler-platey, so it doesn't seem likely the issue would be there.
Any ideas?
Contributor guide
No contributing guide indexed for this repository
Research direction
Reproduce the multi-user WebDAV configuration with debugging enabled, including the custom X-Auth header, and compare the resolved user ID with the served root. Start by examining the Caddyfile parsing code and the WebDAV handler behavior. Done means each authenticated user is served from their own /path/to/webdav/user directory rather than the shared parent path.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100