File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
src/main/kotlin/com/coder/gateway/sdk Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ import java.nio.file.StandardCopyOption
15
15
import java.nio.file.attribute.PosixFilePermissions
16
16
import java.security.DigestInputStream
17
17
import java.security.MessageDigest
18
+ import java.util.zip.GZIPInputStream
18
19
import javax.xml.bind.annotation.adapters.HexBinaryAdapter
19
20
20
21
@@ -86,14 +87,19 @@ class CoderCLIManager(deployment: URL) {
86
87
logger.info(" Found existing binary at ${localBinaryPath.toAbsolutePath()} ; calculated hash as $etag " )
87
88
conn.setRequestProperty(" If-None-Match" , " \" $etag \" " )
88
89
}
90
+ conn.setRequestProperty(" Accept-Encoding" , " gzip" )
89
91
conn.connect()
90
92
logger.info(" GET ${conn.responseCode} $remoteBinaryUrl " )
91
93
when (conn.responseCode) {
92
94
200 -> {
93
95
logger.info(" Downloading binary to ${localBinaryPath.toAbsolutePath()} " )
94
96
Files .createDirectories(destinationDir)
95
97
conn.inputStream.use {
96
- Files .copy(it, localBinaryPath, StandardCopyOption .REPLACE_EXISTING )
98
+ Files .copy(
99
+ if (conn.contentEncoding == " gzip" ) GZIPInputStream (it) else it,
100
+ localBinaryPath,
101
+ StandardCopyOption .REPLACE_EXISTING ,
102
+ )
97
103
}
98
104
if (getOS() != OS .WINDOWS ) {
99
105
Files .setPosixFilePermissions(
You can’t perform that action at this time.
0 commit comments