Skip to content

Commit

Permalink
直接返回拼接后的URL
Browse files Browse the repository at this point in the history
  • Loading branch information
代军 committed Sep 9, 2024
1 parent 0b05e3d commit 8627304
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions go/appbuilder/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,20 @@ func (t *SDKConfig) ServiceURL(suffix string) (*url.URL, error) {
return nil, err
}

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

// 调用 formatURL 进行进一步处理
return t.formatURL(parsedURL, suffix)
// 将路径直接解析为最终 URL
endpoint, err := url.Parse(suffix)
if err != nil {
return nil, err
}

// 解析相对路径
parsedURL = parsedURL.ResolveReference(endpoint)

// 返回拼接后的 URL
return parsedURL, nil
}


Expand Down

0 comments on commit 8627304

Please sign in to comment.