Skip to content

Commit

Permalink
v0.11.6 现在 --endpoint 参数不指定 http(s) 也能正常工作了
Browse files Browse the repository at this point in the history
  • Loading branch information
x5iu committed Sep 11, 2024
1 parent b0e2cfc commit 4eeb2cc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions endpoint_custom.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
package main

import (
"net/url"
"strings"

"github.com/spf13/cobra"
Expand All @@ -18,6 +19,12 @@ func init() {
if !flags.Changed("endpoint") && MoonConfig.Endpoint != "" {
endpoint = MoonConfig.Endpoint
}
if eUrl, err := url.Parse(endpoint); err == nil {
if eUrl.Scheme == "" {
eUrl.Scheme = "https"
}
endpoint = eUrl.String()
}
endpoint = strings.TrimSuffix(endpoint, "/")
})
}
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func init() {
var (
MoonPalace = &cobra.Command{
Use: "moonpalace",
Version: "v0.11.5",
Version: "v0.11.6",
Short: "MoonPalace is a command-line tool for debugging the Moonshot AI HTTP API",
SilenceErrors: true,
SilenceUsage: true,
Expand Down

0 comments on commit 4eeb2cc

Please sign in to comment.