From 57c858fce6ac42d83025b16d1c7ae2f795fe8314 Mon Sep 17 00:00:00 2001 From: siminn-arnorgj <106159316+siminn-arnorgj@users.noreply.github.com> Date: Tue, 24 Jan 2023 11:44:19 +0000 Subject: [PATCH] Allow specifying non-print (#391) --- handle_misc.go | 2 +- handle_misc_test.go | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/handle_misc.go b/handle_misc.go index e7cd8d04..a197c3f1 100644 --- a/handle_misc.go +++ b/handle_misc.go @@ -262,7 +262,7 @@ func (c *clientHandler) handleTYPE(param string) error { case "I", "L8": c.currentTransferType = TransferTypeBinary c.writeMessage(StatusOK, "Type set to binary") - case "A", "L7": + case "A", "AN", "L7": c.currentTransferType = TransferTypeASCII c.writeMessage(StatusOK, "Type set to ASCII") default: diff --git a/handle_misc_test.go b/handle_misc_test.go index d69e3c5d..d08b5ff1 100644 --- a/handle_misc_test.go +++ b/handle_misc_test.go @@ -297,6 +297,10 @@ func TestTYPE(t *testing.T) { require.NoError(t, err) require.Equal(t, StatusOK, rc) + rc, _, err = raw.SendCommand("TYPE A N") + require.NoError(t, err) + require.Equal(t, StatusOK, rc) + rc, _, err = raw.SendCommand("TYPE i") require.NoError(t, err) require.Equal(t, StatusOK, rc)