mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-06 22:30:56 +03:00
WebClient: do not silently overwrite files/directories
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
@@ -112,11 +112,11 @@ func getRespStatus(err error) int {
|
||||
func getMappedStatusCode(err error) int {
|
||||
var statusCode int
|
||||
switch {
|
||||
case errors.Is(err, os.ErrPermission):
|
||||
case errors.Is(err, fs.ErrPermission):
|
||||
statusCode = http.StatusForbidden
|
||||
case errors.Is(err, common.ErrReadQuotaExceeded):
|
||||
statusCode = http.StatusForbidden
|
||||
case errors.Is(err, os.ErrNotExist):
|
||||
case errors.Is(err, fs.ErrNotExist):
|
||||
statusCode = http.StatusNotFound
|
||||
case errors.Is(err, common.ErrQuotaExceeded):
|
||||
statusCode = http.StatusRequestEntityTooLarge
|
||||
|
||||
Reference in New Issue
Block a user