Skip to content

Commit

Permalink
Enhancement: make sure we use the built-in curl binary on windows (la…
Browse files Browse the repository at this point in the history
…uncher)
  • Loading branch information
luskaner committed Dec 18, 2024
1 parent 519999c commit e455f94
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion launcher/internal/server/httpClient.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ package server

import (
"github.com/luskaner/ageLANServer/launcher-common/executor/exec"
"os"
"path/filepath"
"runtime"
)

func HttpGet(url string, insecureSkipVerify bool) int {
Expand All @@ -10,8 +13,14 @@ func HttpGet(url string, insecureSkipVerify bool) int {
args = append(args, "-k")
}
args = append(args, url)
var file string
if runtime.GOOS == "windows" {
// Make sure we use the built-in curl on Windows so it uses the system certificate store
file = filepath.Join(os.Getenv("WINDIR"), "System32")
}
file = filepath.Join(file, "curl")
result := exec.Options{
File: "curl",
File: file,
Args: args,
SpecialFile: true,
Wait: true,
Expand Down

0 comments on commit e455f94

Please sign in to comment.