Fix ftpMock

This commit is contained in:
CrazyMax 2020-05-05 13:34:35 +02:00
parent 0a6572881e
commit 83f3ade61d
No known key found for this signature in database
GPG Key ID: 3248E46B6BB8C7F7

View File

@ -196,8 +196,15 @@ func (mock *ftpMock) listen(t *testing.T) {
mock.proto.Writer.PrintfLine("350 Restarting at %s. Send STORE or RETRIEVE to initiate transfer", cmdParts[1]) mock.proto.Writer.PrintfLine("350 Restarting at %s. Send STORE or RETRIEVE to initiate transfer", cmdParts[1])
case "NOOP": case "NOOP":
mock.proto.Writer.PrintfLine("200 NOOP ok.") mock.proto.Writer.PrintfLine("200 NOOP ok.")
case "OPTS UTF8 ON": case "OPTS":
mock.proto.Writer.PrintfLine("200 OK, UTF-8 enabled") if len(cmdParts) != 3 {
mock.proto.Writer.PrintfLine("500 wrong number of arguments")
break
}
if (strings.Join(cmdParts[1:], " ")) == "UTF8 ON" {
mock.proto.Writer.PrintfLine("200 OK, UTF-8 enabled")
break
}
case "REIN": case "REIN":
mock.proto.Writer.PrintfLine("220 Logged out") mock.proto.Writer.PrintfLine("220 Logged out")
case "QUIT": case "QUIT":