Trim trailing whitespace from list commands
Listing a current directory (when the path argument is empty) would send the command "LIST " with trailing whitespace to FTP resulting in 500 errors with Solaris FTP server. This patch fixes that.
This commit is contained in:
@@ -18,6 +18,7 @@ type ftpMock struct {
|
||||
listener *net.TCPListener
|
||||
proto *textproto.Conn
|
||||
commands []string // list of received commands
|
||||
lastFull string // full last command
|
||||
rest int
|
||||
fileCont *bytes.Buffer
|
||||
dataConn *mockDataConn
|
||||
@@ -66,6 +67,7 @@ func (mock *ftpMock) listen(t *testing.T) {
|
||||
|
||||
for {
|
||||
fullCommand, _ := mock.proto.ReadLine()
|
||||
mock.lastFull = fullCommand
|
||||
|
||||
cmdParts := strings.Split(fullCommand, " ")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user