File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
src/main/kotlin/com/coder/gateway/sdk Expand file tree Collapse file tree 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(
101101 fun downloadCLI (): Boolean {
102102 val etag = getBinaryETag()
103103 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+ }
104110 if (etag != null ) {
105111 logger.info(" Found existing binary at $localBinaryPath ; calculated hash as $etag " )
106112 conn.setRequestProperty(" If-None-Match" , " \" $etag \" " )
@@ -364,6 +370,7 @@ class CoderCLIManager @JvmOverloads constructor(
364370 private fun exec (vararg args : String ): String {
365371 val stdout = ProcessExecutor ()
366372 .command(localBinaryPath.toString(), * args)
373+ .environment(" CODER_HEADER_COMMAND" , settings.headerCommand)
367374 .exitValues(0 )
368375 .readOutput(true )
369376 .execute()
You can’t perform that action at this time.
0 commit comments