Skip to content

Commit c3b2c0a

Browse files
upstream: fix(systeminfo): make HTTPS URL scheme check case-insensitive for CA download (goharbor/harbor#23888)
Per RFC 3986, URL schemes are case-insensitive. In systeminfo controller, enableCADownload previously checked strings.HasPrefix(extURL, "https://") which failed when ExtEndpoint was configured with uppercase or mixed-case scheme (e.g., HTTPS://). Replace with strings.ToLower(extURL) to ensure case-insensitive scheme matching. Fixes # NONE Signed-off-by: Norway-02 <anshulkhetade02@gmail.com> (cherry picked from commit 17b07334f943a32b94bf7306f46eb7348488e8ea) Upstream-Commit: 17b07334f943a32b94bf7306f46eb7348488e8ea Upstream-PR: goharbor/harbor#23888 Upstream-Author: @Norway-02 Cherry-Pick-Status: clean Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 51dda34 commit c3b2c0a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/controller/systeminfo/controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ func (c *controller) GetInfo(ctx context.Context, opt Options) (*Data, error) {
126126
registryURL = l[0]
127127
}
128128
_, caStatErr := os.Stat(defaultRootCert)
129-
enableCADownload := caStatErr == nil && strings.HasPrefix(extURL, "https://")
129+
enableCADownload := caStatErr == nil && strings.HasPrefix(strings.ToLower(extURL), "https://")
130130
res.Protected = &protectedData{
131131
CurrentTime: time.Now(),
132132
ReadOnly: config.ReadOnly(ctx),

0 commit comments

Comments
 (0)