validateQueryAttributes validates query attribute keys
(attrs map[string]string)
| 1287 | |
| 1288 | // validateQueryAttributes validates query attribute keys |
| 1289 | func validateQueryAttributes(attrs map[string]string) error { |
| 1290 | for key := range attrs { |
| 1291 | if !queryAttributeKeyRegex.MatchString(key) { |
| 1292 | return fmt.Errorf("query attribute key %q contains invalid characters (must be alphanumeric with underscores, hyphens, or dots only)", key) |
| 1293 | } |
| 1294 | } |
| 1295 | return nil |
| 1296 | } |
| 1297 | |
| 1298 | var queryAttributeKeyRegex = regexp.MustCompile(`^[a-zA-Z0-9_.-]+$`) |