Skip to content

Broken comma-separated splitting logic #256

@SgtCoDFish

Description

@SgtCoDFish

When parsing URIs we use splitList which is defined locally:

for _, uriS := range splitList(csv) {

// splitList returns the given csv as a slice. Trims space of each element.
func splitList(csv string) []string {
var list []string
for _, s := range strings.Split(csv, ",") {
list = append(list, strings.TrimSpace(s))
}
return list
}

This split function has no support for escaping commas and as such could be invalid for certain URIs which can legally contain commas. Ideally we should use CSV parsing logic instead, which would allow URIs containing commas to be used.

For related discussion in a review of a cert-manager feature, see: cert-manager/cert-manager#4502 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions