mirror of
https://github.com/hacdias/webdav.git
synced 2026-09-23 19:51:53 +08:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8c66f0c585 |
@@ -40,6 +40,16 @@ func (c *Config) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
u = user
|
u = user
|
||||||
|
} else {
|
||||||
|
// Even if Auth is disabled, we might want to get
|
||||||
|
// the user from the Basic Auth header. Useful for Caddy
|
||||||
|
// plugin implementation.
|
||||||
|
username, _, ok := r.BasicAuth()
|
||||||
|
if ok {
|
||||||
|
if user, ok := c.Users[username]; ok {
|
||||||
|
u = user
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Checks for user permissions relatively to this PATH.
|
// Checks for user permissions relatively to this PATH.
|
||||||
|
|||||||
Reference in New Issue
Block a user