Skip to content

Commit 2a0c93b

Browse files
author
Prince Rachit Sinha
committed
[image-builder] Split auth string into only two
1 parent f0bf2e8 commit 2a0c93b

File tree

2 files changed

+2
-2
lines changed
  • components

2 files changed

+2
-2
lines changed

components/image-builder-bob/pkg/proxy/auth.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func (a MapAuthorizer) Authorize(host string) (user, pass string, err error) {
4242
if err != nil {
4343
return
4444
}
45-
segs := strings.Split(string(auth), ":")
45+
segs := strings.SplitN(string(auth), ":", 1)
4646
if len(segs) < 2 {
4747
return
4848
}

components/image-builder-mk3/pkg/auth/auth.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ func (a AllowedAuthFor) additionalAuth(domain string) *Authentication {
207207
}
208208
dec, err := base64.StdEncoding.DecodeString(ath)
209209
if err == nil {
210-
segs := strings.Split(string(dec), ":")
210+
segs := strings.SplitN(string(dec), ":", 1)
211211
if len(segs) == 2 {
212212
res.Username = segs[0]
213213
res.Password = segs[1]

0 commit comments

Comments
 (0)