Skip to content

Commit

Permalink
Fixed panic with http status codes
Browse files Browse the repository at this point in the history
  • Loading branch information
Ice3man543 committed Mar 13, 2021
1 parent 31094ab commit a302914
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion v2/pkg/protocols/http/operators.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ func (r *Request) Match(data map[string]interface{}, matcher *matchers.Matcher)
if !ok {
return false
}
return matcher.Result(matcher.MatchStatusCode(statusCode.(int)))
status, ok := statusCode.(int)
if !ok {
return false
}
return matcher.Result(matcher.MatchStatusCode(status))
case matchers.SizeMatcher:
return matcher.Result(matcher.MatchSize(len(item)))
case matchers.WordsMatcher:
Expand Down

0 comments on commit a302914

Please sign in to comment.