UP
This commit is contained in:
parent
89a37a1c7c
commit
08b05bd7da
@ -663,7 +663,15 @@ func StreamHandler(w http.ResponseWriter, r *http.Request) {
|
||||
func DetailHandler(w http.ResponseWriter, r *http.Request) {
|
||||
base := "/app/uploads"
|
||||
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 {
|
||||
http.NotFound(w, r)
|
||||
return
|
||||
|
||||
Loading…
Reference in New Issue
Block a user