Fixed panic with http status codes

dev
Ice3man543 2021-03-13 23:20:04 +05:30
parent 31094ab299
commit a3029142f6
1 changed files with 5 additions and 1 deletions

View File

@ -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: