Skip to content

Commit

Permalink
更新了ServiceURL函数至支持的版本
Browse files Browse the repository at this point in the history
  • Loading branch information
代军 committed Sep 9, 2024
1 parent da0dfa5 commit 0b05e3d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions go/appbuilder/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,17 @@ func (t *SDKConfig) authHeader() http.Header {
}

func (t *SDKConfig) ServiceURL(suffix string) (*url.URL, error) {
absolutePath, err := url.JoinPath(t.GatewayURL)
// 解析 GatewayURL
parsedURL, err := url.Parse(t.GatewayURL)
if err != nil {
return nil, err
}
return t.formatURL(absolutePath, suffix)

// 使用 path.Join 进行路径拼接
parsedURL.Path = path.Join(parsedURL.Path, suffix)

// 调用 formatURL 进行进一步处理
return t.formatURL(parsedURL, suffix)
}


Expand Down

0 comments on commit 0b05e3d

Please sign in to comment.