From 83f3ade61d72b87403b99853e47799ba06d42857 Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Tue, 5 May 2020 13:34:35 +0200 Subject: [PATCH] Fix ftpMock --- conn_test.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/conn_test.go b/conn_test.go index b8b8172..11be24d 100644 --- a/conn_test.go +++ b/conn_test.go @@ -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]) case "NOOP": mock.proto.Writer.PrintfLine("200 NOOP ok.") - case "OPTS UTF8 ON": - mock.proto.Writer.PrintfLine("200 OK, UTF-8 enabled") + case "OPTS": + 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": mock.proto.Writer.PrintfLine("220 Logged out") case "QUIT":