mirror of
https://github.com/hacdias/webdav.git
synced 2026-09-26 21:21:54 +08:00
fix: panic when getting requests
This commit is contained in:
+1
-2
@@ -15,7 +15,6 @@ type handlerUser struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type Handler struct {
|
type Handler struct {
|
||||||
*Config
|
|
||||||
user *handlerUser
|
user *handlerUser
|
||||||
users map[string]*handlerUser
|
users map[string]*handlerUser
|
||||||
}
|
}
|
||||||
@@ -70,7 +69,7 @@ func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||||||
user := h.user
|
user := h.user
|
||||||
|
|
||||||
// Authentication
|
// Authentication
|
||||||
if h.Auth {
|
if len(h.users) > 0 {
|
||||||
w.Header().Set("WWW-Authenticate", `Basic realm="Restricted"`)
|
w.Header().Set("WWW-Authenticate", `Basic realm="Restricted"`)
|
||||||
|
|
||||||
// Gets the correct user for this request.
|
// Gets the correct user for this request.
|
||||||
|
|||||||
Reference in New Issue
Block a user