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