mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-08 07:10:56 +03:00
printf: replace %#v with the more explicit %q
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
@@ -237,7 +237,7 @@ func (s *httpdServer) downloadBrowsableSharedFile(w http.ResponseWriter, r *http
|
||||
return
|
||||
}
|
||||
if info.IsDir() {
|
||||
sendAPIResponse(w, r, nil, fmt.Sprintf("Please set the path to a valid file, %#v is a directory", name),
|
||||
sendAPIResponse(w, r, nil, fmt.Sprintf("Please set the path to a valid file, %q is a directory", name),
|
||||
http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
@@ -541,7 +541,7 @@ func getBrowsableSharedPath(share dataprovider.Share, r *http.Request) (string,
|
||||
return name, nil
|
||||
}
|
||||
if name != share.Paths[0] && !strings.HasPrefix(name, share.Paths[0]+"/") {
|
||||
return "", util.NewValidationError(fmt.Sprintf("Invalid path %#v", r.URL.Query().Get("path")))
|
||||
return "", util.NewValidationError(fmt.Sprintf("Invalid path %q", r.URL.Query().Get("path")))
|
||||
}
|
||||
return name, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user