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 // do decompression
if fstats.IsCompressed { if fstats.IsCompressed && !fstats.IsDir {
decrypted = compress.Decompress(decrypted) decrypted = compress.Decompress(decrypted)
} }

View File

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