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

typo #319

Merged
merged 3 commits into from
Nov 14, 2023
Merged

typo #319

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified cpuprofile
Binary file not shown.
5 changes: 2 additions & 3 deletions primaryHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -568,13 +568,12 @@ func ValidateWRP(logger *zap.Logger) func(http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {

if msg, ok := wrpcontext.GetMessage(r.Context()); ok {
var err error
var failureError error
var warningErrors error

validators := wrp.SpecValidators()
for _, v := range validators {
err = v.Validate(*msg)
err := v.Validate(*msg)
if errors.Is(err, wrp.ErrorInvalidMessageEncoding.Err) || errors.Is(err, wrp.ErrorInvalidMessageType.Err) {
failureError = multierr.Append(failureError, err)
} else if errors.Is(err, wrp.ErrorInvalidDestination.Err) || errors.Is(err, wrp.ErrorInvalidSource.Err) {
Expand All @@ -595,7 +594,7 @@ func ValidateWRP(logger *zap.Logger) func(http.Handler) http.Handler {
w,
`{"code": %d, "message": "%s"}`,
http.StatusBadRequest,
fmt.Sprintf("failed to validate WRP message: %s", err))
fmt.Sprintf("failed to validate WRP message: %s", failureError))
return
}
}
Expand Down