Skip to content

Commit

Permalink
Expose ExpressionSizeCodePointLimit as env option. (#720)
Browse files Browse the repository at this point in the history
  • Loading branch information
notyourusualaccountname2 authored May 30, 2023
1 parent bf620b2 commit ad926f0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions cel/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -568,3 +568,12 @@ func ParserRecursionLimit(limit int) EnvOption {
return e, nil
}
}

// ParserExpressionSizeLimit adjusts the number of code points the expression parser is allowed to parse.
// Defaults defined in the parser package.
func ParserExpressionSizeLimit(limit int) EnvOption {
return func(e *Env) (*Env, error) {
e.prsrOpts = append(e.prsrOpts, parser.ExpressionSizeCodePointLimit(limit))
return e, nil
}
}

0 comments on commit ad926f0

Please sign in to comment.