File tree 1 file changed +7
-0
lines changed
src/main/kotlin/com/coder/gateway/sdk
1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -101,6 +101,12 @@ class CoderCLIManager @JvmOverloads constructor(
101
101
fun downloadCLI (): Boolean {
102
102
val etag = getBinaryETag()
103
103
val conn = remoteBinaryURL.openConnection() as HttpURLConnection
104
+ if (settings.headerCommand.isNotBlank()) {
105
+ val headersFromHeaderCommand = CoderRestClient .getHeaders(deploymentURL, settings.headerCommand)
106
+ for ((key, value) in headersFromHeaderCommand) {
107
+ conn.setRequestProperty(key, value)
108
+ }
109
+ }
104
110
if (etag != null ) {
105
111
logger.info(" Found existing binary at $localBinaryPath ; calculated hash as $etag " )
106
112
conn.setRequestProperty(" If-None-Match" , " \" $etag \" " )
@@ -364,6 +370,7 @@ class CoderCLIManager @JvmOverloads constructor(
364
370
private fun exec (vararg args : String ): String {
365
371
val stdout = ProcessExecutor ()
366
372
.command(localBinaryPath.toString(), * args)
373
+ .environment(" CODER_HEADER_COMMAND" , settings.headerCommand)
367
374
.exitValues(0 )
368
375
.readOutput(true )
369
376
.execute()
You can’t perform that action at this time.
0 commit comments