File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -450,6 +450,9 @@ func parseScopes(s []string) scopes {
450
450
// https://docs.docker.com/registry/spec/auth/scope/
451
451
m := map [string ]map [string ]struct {}{}
452
452
for _ , scopeStr := range s {
453
+ if scopeStr == "" {
454
+ return nil
455
+ }
453
456
// The scopeStr may have strings that contain multiple scopes separated by a space.
454
457
for _ , scope := range strings .Split (scopeStr , " " ) {
455
458
parts := strings .SplitN (scope , ":" , 3 )
Original file line number Diff line number Diff line change @@ -11,6 +11,11 @@ func TestParseScopes(t *testing.T) {
11
11
input []string
12
12
expected scopes
13
13
}{
14
+ {
15
+ name : "InvalidScope" ,
16
+ input : []string {"" },
17
+ expected : nil ,
18
+ },
14
19
{
15
20
name : "SeparateStrings" ,
16
21
input : []string {
You can’t perform that action at this time.
0 commit comments