up
This commit is contained in:
parent
0f300c3e72
commit
90810eefd4
@ -110,8 +110,8 @@ r.PathPrefix("/webdav/").Handler(http.HandlerFunc(func(w http.ResponseWriter, re
|
|||||||
http.Error(w, "Unauthorized", http.StatusUnauthorized)
|
http.Error(w, "Unauthorized", http.StatusUnauthorized)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
log.Printf("✅ email saisie: %s", email)
|
log.Printf("✅ email saisi: %s", email)
|
||||||
log.Printf("✅ passw saisie: %s", password)
|
log.Printf("✅ password saisi: %s", password)
|
||||||
|
|
||||||
var user models.User
|
var user models.User
|
||||||
result := bd.Where("email = ?", email).First(&user)
|
result := bd.Where("email = ?", email).First(&user)
|
||||||
@ -128,17 +128,14 @@ r.PathPrefix("/webdav/").Handler(http.HandlerFunc(func(w http.ResponseWriter, re
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Lecture seule
|
// ✅ Ici on autorise TOUTES les méthodes WebDAV (lecture/écriture/suppression)
|
||||||
if req.Method != "GET" && req.Method != "HEAD" && req.Method != "OPTIONS" && req.Method != "PROPFIND" {
|
log.Printf("✅ WebDAV FULL ACCESS for user: %s", email)
|
||||||
http.Error(w, "Read-Only", http.StatusForbidden)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
log.Printf("✅ WebDAV access for user: %s", email)
|
|
||||||
|
|
||||||
|
// Headers WebDAV que certains clients attendent
|
||||||
w.Header().Set("DAV", "1,2")
|
w.Header().Set("DAV", "1,2")
|
||||||
w.Header().Set("MS-Author-Via", "DAV")
|
w.Header().Set("MS-Author-Via", "DAV")
|
||||||
|
|
||||||
|
// Handler WebDAV complet
|
||||||
webdavHandler := &webdav.Handler{
|
webdavHandler := &webdav.Handler{
|
||||||
Prefix: "/webdav/",
|
Prefix: "/webdav/",
|
||||||
FileSystem: webdav.Dir("/app/upload"),
|
FileSystem: webdav.Dir("/app/upload"),
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user