Skip to content

Commit

Permalink
fix: handle corner case
Browse files Browse the repository at this point in the history
  • Loading branch information
aripalo committed May 8, 2022
1 parent 7bb3e3c commit 93e10cb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions internal/assumecfg/resolvers.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,12 @@ func getSessionIdentifier() string {
func format(id string) string {
cleaned := removeDisallowed(id)
truncated := truncate(cleaned)

// handle extremely rare situation where the cleaned string is too short
if len(truncated) <= minLength {
return fmt.Sprintf("mysession-%s", truncated)
}

return truncated
}

Expand Down

0 comments on commit 93e10cb

Please sign in to comment.