This commit is contained in:
Michael Quigley 2025-06-10 14:50:03 -04:00
parent 20f0f3a0e8
commit 801007dd42
No known key found for this signature in database
GPG Key ID: 9B60314A9DD20A62

View File

@ -99,7 +99,6 @@ func (p *OIDCProvider) setupHandlers(cfg *OauthConfig, key []byte, tls bool) {
return
}
// Clean up the host value
host = strings.TrimSpace(host)
if host == "" {
logrus.Error("target host is empty")
@ -108,13 +107,11 @@ func (p *OIDCProvider) setupHandlers(cfg *OauthConfig, key []byte, tls bool) {
return
}
// Remove any scheme, path, or query parameters
if strings.Contains(host, "://") {
if parsedURL, err := url.Parse(host); err == nil && parsedURL.Host != "" {
host = parsedURL.Host
}
}
// If there's still a path component, take only the first part
host = strings.Split(host, "/")[0]
if host == "" {