Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
### Fixed

- NPE during error reporting
- relaxed `Content-Type` checks while downloading the CLI

## 0.6.3 - 2025-08-25

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,18 @@ import java.util.zip.GZIPInputStream
import kotlin.io.path.name
import kotlin.io.path.notExists

private val SUPPORTED_BIN_MIME_TYPES = listOf(
"application/octet-stream",
"application/exe",
"application/dos-exe",
"application/msdos-windows",
"application/x-exe",
"application/x-msdownload",
"application/x-winexe",
"application/x-msdos-program",
"application/x-msdos-executable",
"application/vnd.microsoft.portable-executable"
)
/**
* Handles the download steps of Coder CLI
*/
Expand Down Expand Up @@ -52,7 +64,7 @@ class CoderDownloadService(
return when (response.code()) {
HTTP_OK -> {
val contentType = response.headers()["Content-Type"]?.lowercase()
if (contentType?.startsWith("application/octet-stream") != true) {
if (contentType !in SUPPORTED_BIN_MIME_TYPES) {
throw ResponseException(
"Invalid content type '$contentType' when downloading CLI from $remoteBinaryURL. Expected application/octet-stream.",
response.code()
Expand Down
Loading