Skip to content

Commit

Permalink
rollback panics
Browse files Browse the repository at this point in the history
  • Loading branch information
jptosso committed Nov 2, 2023
1 parent 13c7e4b commit 369e6d6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/corazawaf/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -549,13 +549,13 @@ func (tx *Transaction) GetField(rv ruleVariableParams) []types.MatchData {
if m, ok := col.(collection.Keyed); ok {
matches = m.FindRegex(rv.KeyRx)
} else {
tx.WAF.Logger.Error().Msg("attempted to use regex with non-selectable collection: " + rv.Variable.Name())
panic("attempted to use regex with non-selectable collection: " + rv.Variable.Name())
}
case rv.KeyStr != "":
if m, ok := col.(collection.Keyed); ok {
matches = m.FindString(rv.KeyStr)
} else {
tx.WAF.Logger.Error().Msg("attempted to use string with non-selectable collection: " + rv.Variable.Name())
panic("attempted to use string with non-selectable collection: " + rv.Variable.Name())
}
default:
matches = col.FindAll()
Expand Down

0 comments on commit 369e6d6

Please sign in to comment.