This commit is contained in:
cangui 2025-06-20 18:12:28 +02:00
parent 89a37a1c7c
commit 08b05bd7da

View File

@ -663,7 +663,15 @@ func StreamHandler(w http.ResponseWriter, r *http.Request) {
func DetailHandler(w http.ResponseWriter, r *http.Request) { func DetailHandler(w http.ResponseWriter, r *http.Request) {
base := "/app/uploads" base := "/app/uploads"
rel := r.URL.Query().Get("path") rel := r.URL.Query().Get("path")
info, err := os.Stat(filepath.Join(base, rel))
// Nettoyage : retirer un éventuel slash au début
rel = strings.TrimPrefix(rel, "/")
absPath := filepath.Join(base, rel)
fmt.Println("PATH demandé:", rel)
fmt.Println("Chemin complet:", filepath.Join(base, rel))
info, err := os.Stat(absPath)
if err != nil { if err != nil {
http.NotFound(w, r) http.NotFound(w, r)
return return