Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion conn_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ func (mock *ftpMock) listen() {
if cmdParts[1] == "multiline-dir" {
mock.printfLine("250-File data\r\n Type=dir;Size=0; multiline-dir\r\n Modify=20201213202400; multiline-dir\r\n250 End")
} else {
mock.printfLine("250-File data\r\n Type=file;Size=42;Modify=20201213202400; magic-file\r\n \r\n250 End")
mock.printfLine("250-File data\r\n Type=file;Size=42;Modify=20201213202400; magic-file\r\n \r\n250 End")
}
case "NLST":
if mock.dataConn == nil {
Expand Down
6 changes: 3 additions & 3 deletions ftp.go
Original file line number Diff line number Diff line change
Expand Up @@ -778,9 +778,9 @@ func (c *ServerConn) GetEntry(path string) (entry *Entry, err error) {
e := &Entry{}
for _, l := range lines[1 : lc-1] {
// According to RFC 3659, the entry lines must start with a space when passed over the
// control connection. Some servers don't seem to add that space though. Both forms are
// accepted here.
if len(l) > 0 && l[0] == ' ' {
// control connection. Some servers don't seem to add that space though and some servers
// add multiple spaces. All forms are accepted here.
for len(l) > 0 && l[0] == ' ' {
l = l[1:]
}
// Some severs seem to send a blank line at the end which we ignore
Expand Down
Loading