mirror of
https://github.com/coder/coder.git
synced 2025-07-15 22:20:27 +00:00
chore: return safe copy of string slice in 'ParseStringSliceClaim' (#17439)
Claims parsed should be safe to mutate and filter. This was likely not causing any bugs or issues, and just doing this out of precaution
This commit is contained in:
@ -186,7 +186,9 @@ func ParseStringSliceClaim(claim interface{}) ([]string, error) {
|
||||
// The simple case is the type is exactly what we expected
|
||||
asStringArray, ok := claim.([]string)
|
||||
if ok {
|
||||
return asStringArray, nil
|
||||
cpy := make([]string, len(asStringArray))
|
||||
copy(cpy, asStringArray)
|
||||
return cpy, nil
|
||||
}
|
||||
|
||||
asArray, ok := claim.([]interface{})
|
||||
|
Reference in New Issue
Block a user