Skip to content

Commit d09dd05

Browse files
committed
fix ftp.go to pass testflows
1 parent 950408a commit d09dd05

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pkg/storage/ftp.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,12 @@ func (f *ftpPoolFactory) ValidateObject(ctx context.Context, object *pool.Pooled
445445
// Validate connection by sending NOOP command
446446
conn := object.Object.(*ftp.ServerConn)
447447
if err := conn.NoOp(); err != nil {
448+
// Some FTP servers (like pure-ftpd) don't support NOOP command and return "500 Unknown command"
449+
// This still means the connection is alive (server received and responded to command)
450+
if strings.HasPrefix(err.Error(), "500") {
451+
log.Debug().Msgf("ftpPoolFactory->ValidateObject NoOp returned 500 (command not supported), connection still valid")
452+
return true
453+
}
448454
log.Debug().Msgf("ftpPoolFactory->ValidateObject NoOp failed: %v", err)
449455
return false
450456
}

0 commit comments

Comments
 (0)