fix: allow http:// URLs in custom-sign-in-logo flag

The --custom-sign-in-logo flag previously only accepted https:// URLs
and would incorrectly interpret http:// URLs as file paths, causing the
application to fail to start.

This fix adds support for http:// URLs alongside the existing https://
support.
This commit is contained in:
Br1an67 2026-03-06 18:42:29 +00:00
parent 88075737a6
commit 68b2cbe70f
2 changed files with 6 additions and 1 deletions

View File

@ -105,7 +105,7 @@ func loadCustomLogo(logoPath string) (string, error) {
return "", nil
}
if strings.HasPrefix(logoPath, "https://") {
if strings.HasPrefix(logoPath, "https://") || strings.HasPrefix(logoPath, "http://") {
// Return img tag pointing to the URL.
return fmt.Sprintf("<img src=\"%s\" alt=\"Logo\" />", logoPath), nil
}

View File

@ -131,6 +131,11 @@ var _ = Describe("SignIn Page", func() {
expectedErr: nil,
expectedData: "<img src=\"https://raw.githubusercontent.com/oauth2-proxy/oauth2-proxy/master/docs/static/img/logos/OAuth2_Proxy_icon.png\" alt=\"Logo\" />",
}),
Entry("with HTTP URL", loadCustomLogoTableInput{
logoPath: "http://example.com/logo.png",
expectedErr: nil,
expectedData: "<img src=\"http://example.com/logo.png\" alt=\"Logo\" />",
}),
Entry("with an svg custom logo", loadCustomLogoTableInput{
logoPath: "customDir/logo.svg",
expectedErr: nil,