1
0
mirror of https://github.com/schollz/croc.git synced 2024-12-18 03:01:31 +03:00

only compress if its not a directory

This commit is contained in:
Zack Scholl 2018-09-22 10:59:45 -07:00
parent c6374da410
commit 232f3375b1
2 changed files with 2 additions and 2 deletions

View File

@ -168,7 +168,7 @@ func receive(c *websocket.Conn, codephrase string, noPrompt bool, useStdout bool
}
// do decompression
if fstats.IsCompressed {
if fstats.IsCompressed && !fstats.IsDir {
decrypted = compress.Decompress(decrypted)
}

View File

@ -179,7 +179,7 @@ func send(c *websocket.Conn, fname string, codephrase string, useCompression boo
if bytesread > 0 {
// do compression
var compressedBytes []byte
if useCompression {
if useCompression && !fstats.IsDir {
compressedBytes = compress.Compress(buffer[:bytesread])
} else {
compressedBytes = buffer[:bytesread]