Skip to content

Commit

Permalink
fix(NewClient): support https:// URLs (#277)
Browse files Browse the repository at this point in the history
* fix(NewClient): support https:// URLs

We don't hardcode any specific ports, but assume `http://`
(backward-compatible behavior)  unless `https://` is passed (then we
keep it as-is).

* chore: v0.14.1

this is backward-compatible fix, ok to just bump patch
  • Loading branch information
lidel authored Jan 10, 2025
1 parent 2432d3e commit a32ea33
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion http/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ func ClientWithRawAbsPath(rawAbsPath bool) ClientOpt {

// NewClient constructs a new HTTP-backed command executor.
func NewClient(address string, opts ...ClientOpt) cmds.Executor {
if !strings.HasPrefix(address, "http://") {
// default to HTTP to keep backward-compatible behavior, but keep https:// if passed
if !strings.HasPrefix(address, "http:") && !strings.HasPrefix(address, "https:") {
address = "http://" + address
}

Expand Down
2 changes: 1 addition & 1 deletion version.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "v0.14.0"
"version": "v0.14.1"
}

0 comments on commit a32ea33

Please sign in to comment.