mirror of
https://github.com/openziti/zrok.git
synced 2025-06-26 20:52:33 +02:00
lint (#968)
This commit is contained in:
parent
20f0f3a0e8
commit
801007dd42
@ -99,7 +99,6 @@ func (p *OIDCProvider) setupHandlers(cfg *OauthConfig, key []byte, tls bool) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clean up the host value
|
|
||||||
host = strings.TrimSpace(host)
|
host = strings.TrimSpace(host)
|
||||||
if host == "" {
|
if host == "" {
|
||||||
logrus.Error("target host is empty")
|
logrus.Error("target host is empty")
|
||||||
@ -108,13 +107,11 @@ func (p *OIDCProvider) setupHandlers(cfg *OauthConfig, key []byte, tls bool) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove any scheme, path, or query parameters
|
|
||||||
if strings.Contains(host, "://") {
|
if strings.Contains(host, "://") {
|
||||||
if parsedURL, err := url.Parse(host); err == nil && parsedURL.Host != "" {
|
if parsedURL, err := url.Parse(host); err == nil && parsedURL.Host != "" {
|
||||||
host = parsedURL.Host
|
host = parsedURL.Host
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// If there's still a path component, take only the first part
|
|
||||||
host = strings.Split(host, "/")[0]
|
host = strings.Split(host, "/")[0]
|
||||||
|
|
||||||
if host == "" {
|
if host == "" {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user