Trim any space when we format the error message sent back to the client. (#14066)

A trailing whitespace gets included if the error is not a RFC7807 model.
This commit is contained in:
Ian Cubbon 2022-11-20 07:35:21 -07:00 committed by GitHub
parent 67067b1b3c
commit 903ff0ba47
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 4 deletions

View File

@ -712,5 +712,5 @@ func formatErrorMessage(status string, v interface{}) string {
} }
// status title (detail) // status title (detail)
return fmt.Sprintf("%s %s", status, str) return strings.TrimSpace(fmt.Sprintf("%s %s", status, str))
} }

View File

@ -672,5 +672,5 @@ func formatErrorMessage(status string, v interface{}) string {
} }
// status title (detail) // status title (detail)
return fmt.Sprintf("%s %s", status, str) return strings.TrimSpace(fmt.Sprintf("%s %s", status, str))
} }

View File

@ -657,5 +657,5 @@ func formatErrorMessage(status string, v interface{}) string {
} }
// status title (detail) // status title (detail)
return fmt.Sprintf("%s %s", status, str) return strings.TrimSpace(fmt.Sprintf("%s %s", status, str))
} }

View File

@ -685,5 +685,5 @@ func formatErrorMessage(status string, v interface{}) string {
} }
// status title (detail) // status title (detail)
return fmt.Sprintf("%s %s", status, str) return strings.TrimSpace(fmt.Sprintf("%s %s", status, str))
} }