Merging upstream version 0.8.13.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
4ccf9dc8f1
commit
bc0f764250
28 changed files with 556 additions and 76 deletions
|
@ -55,12 +55,18 @@ func (config *Config) SetURL(url *url.URL) error {
|
|||
// It sets the host, path, and query parameters, validating host and path, and returns an error if parsing or validation fails.
|
||||
func (config *Config) setURL(resolver types.ConfigQueryResolver, url *url.URL) error {
|
||||
config.Host = url.Host
|
||||
if config.Host != larkHost && config.Host != feishuHost {
|
||||
// Handle documentation generation or empty host
|
||||
if config.Host == "" || (url.User != nil && url.User.Username() == "dummy") {
|
||||
config.Host = "open.larksuite.com"
|
||||
} else if config.Host != larkHost && config.Host != feishuHost {
|
||||
return ErrInvalidHost
|
||||
}
|
||||
|
||||
config.Path = strings.Trim(url.Path, "/")
|
||||
if config.Path == "" {
|
||||
// Handle documentation generation with empty path
|
||||
if config.Path == "" && (url.User != nil && url.User.Username() == "dummy") {
|
||||
config.Path = "token"
|
||||
} else if config.Path == "" {
|
||||
return ErrNoPath
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue