Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc2d658b

Browse files
authored
fix: relaxed Content-Type checks for CLI download (#189)
This PR fixes download failure for Windows .exe binaries by relaxingstrict Content-Type checks. Previously, the plugin only acceptedapplication/octet-stream, causing failures when .exe files were servedas application/x-msdos-executable by some servers.-resolves#187
1 parenta68ab3a commitc2d658b

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

‎CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
###Fixed
1010

1111
- NPE during error reporting
12+
- relaxed`Content-Type` checks while downloading the CLI
1213

1314
##0.6.3 - 2025-08-25
1415

‎src/main/kotlin/com/coder/toolbox/cli/downloader/CoderDownloadService.kt‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,18 @@ import java.util.zip.GZIPInputStream
2525
importkotlin.io.path.name
2626
importkotlin.io.path.notExists
2727

28+
privatevalSUPPORTED_BIN_MIME_TYPES=listOf(
29+
"application/octet-stream",
30+
"application/exe",
31+
"application/dos-exe",
32+
"application/msdos-windows",
33+
"application/x-exe",
34+
"application/x-msdownload",
35+
"application/x-winexe",
36+
"application/x-msdos-program",
37+
"application/x-msdos-executable",
38+
"application/vnd.microsoft.portable-executable"
39+
)
2840
/**
2941
* Handles the download steps of Coder CLI
3042
*/
@@ -52,7 +64,7 @@ class CoderDownloadService(
5264
returnwhen (response.code()) {
5365
HTTP_OK-> {
5466
val contentType= response.headers()["Content-Type"]?.lowercase()
55-
if (contentType?.startsWith("application/octet-stream")!=true) {
67+
if (contentType!inSUPPORTED_BIN_MIME_TYPES) {
5668
throwResponseException(
5769
"Invalid content type '$contentType' when downloading CLI from$remoteBinaryURL. Expected application/octet-stream.",
5870
response.code()

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp