From 68b2cbe70fe13be23173c98dc84cc35705f280f0 Mon Sep 17 00:00:00 2001 From: Br1an67 <932039080@qq.com> Date: Fri, 6 Mar 2026 18:42:29 +0000 Subject: [PATCH] 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. --- pkg/app/pagewriter/sign_in_page.go | 2 +- pkg/app/pagewriter/sign_in_page_test.go | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/app/pagewriter/sign_in_page.go b/pkg/app/pagewriter/sign_in_page.go index bb34bb49..4286c730 100644 --- a/pkg/app/pagewriter/sign_in_page.go +++ b/pkg/app/pagewriter/sign_in_page.go @@ -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("\"Logo\"", logoPath), nil } diff --git a/pkg/app/pagewriter/sign_in_page_test.go b/pkg/app/pagewriter/sign_in_page_test.go index eb95ded8..a183fb3e 100644 --- a/pkg/app/pagewriter/sign_in_page_test.go +++ b/pkg/app/pagewriter/sign_in_page_test.go @@ -131,6 +131,11 @@ var _ = Describe("SignIn Page", func() { expectedErr: nil, expectedData: "\"Logo\"", }), + Entry("with HTTP URL", loadCustomLogoTableInput{ + logoPath: "http://example.com/logo.png", + expectedErr: nil, + expectedData: "\"Logo\"", + }), Entry("with an svg custom logo", loadCustomLogoTableInput{ logoPath: "customDir/logo.svg", expectedErr: nil,