update where shell starts and add override -home setting
This commit is contained in:
@@ -374,7 +374,7 @@ func handleUpload(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
destDir := strings.TrimSpace(r.FormValue("dest"))
|
||||
if destDir == "" {
|
||||
destDir = initialCwd
|
||||
destDir = shellHome
|
||||
}
|
||||
destPath := filepath.Join(filepath.Clean(destDir), filepath.Base(header.Filename))
|
||||
|
||||
@@ -400,7 +400,7 @@ func handleDownload(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
full := filepath.Clean(path)
|
||||
if !filepath.IsAbs(full) {
|
||||
full = filepath.Join(initialCwd, full)
|
||||
full = filepath.Join(shellHome, full)
|
||||
}
|
||||
if _, err := os.Stat(full); err != nil {
|
||||
http.Error(w, "file not found", http.StatusNotFound)
|
||||
|
||||
Reference in New Issue
Block a user