Skip to content

Commit

Permalink
storage presign: fix panic when parsing arg[0]
Browse files Browse the repository at this point in the history
  • Loading branch information
sauterp committed Apr 15, 2024
1 parent 032b0d2 commit bc0b76c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cmd/storage_presign.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ var storagePresignCmd = &cobra.Command{
}

parts := strings.SplitN(args[0], "/", 2)
if len(parts) < 2 {
return fmt.Errorf("invalid object URL: %q", args[0])
}
bucket, key = parts[0], parts[1]

storage, err := sos.NewStorageClient(
Expand Down

0 comments on commit bc0b76c

Please sign in to comment.