Config file and parse configuration

This commit is contained in:
Henrique Dias
2017-08-03 15:18:28 +01:00
parent 37f7de2fd3
commit 90c49f4e07
3 changed files with 221 additions and 4 deletions
+1 -3
View File
@@ -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