Make IsHTTPHeaderName return error strings

This commit is contained in:
Tim Hockin
2016-02-14 13:03:30 -08:00
parent 3ad6c397d7
commit 37786e0e77
3 changed files with 12 additions and 9 deletions

View File

@@ -1314,8 +1314,8 @@ func validateHTTPGetAction(http *api.HTTPGetAction, fldPath *field.Path) field.E
allErrors = append(allErrors, field.NotSupported(fldPath.Child("scheme"), http.Scheme, supportedHTTPSchemes.List()))
}
for _, header := range http.HTTPHeaders {
if !validation.IsHTTPHeaderName(header.Name) {
allErrors = append(allErrors, field.Invalid(fldPath.Child("httpHeaders"), header.Name, fmt.Sprintf("name must match %s", validation.HTTPHeaderNameFmt)))
for _, msg := range validation.IsHTTPHeaderName(header.Name) {
allErrors = append(allErrors, field.Invalid(fldPath.Child("httpHeaders"), header.Name, msg))
}
}
return allErrors