Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken comma-separated splitting logic #256

Open
SgtCoDFish opened this issue May 9, 2024 · 0 comments
Open

Broken comma-separated splitting logic #256

SgtCoDFish opened this issue May 9, 2024 · 0 comments

Comments

@SgtCoDFish
Copy link
Member

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant