mirror of
https://github.com/hacdias/webdav.git
synced 2026-09-24 04:01:54 +08:00
Config file and parse configuration
This commit is contained in:
@@ -6,8 +6,6 @@ import (
|
||||
"regexp"
|
||||
"strings"
|
||||
|
||||
"github.com/mholt/caddy/caddyhttp/httpserver"
|
||||
|
||||
"golang.org/x/net/webdav"
|
||||
)
|
||||
|
||||
@@ -23,7 +21,7 @@ func (c *Config) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
u := c.User
|
||||
|
||||
// Gets the correct user for this request.
|
||||
username, ok := r.Context().Value(httpserver.RemoteUserCtxKey).(string)
|
||||
username, _, ok := r.BasicAuth()
|
||||
if ok {
|
||||
if user, ok := c.Users[username]; ok {
|
||||
u = user
|
||||
|
||||
Reference in New Issue
Block a user