Skip to content

Commit fede2d0

Browse files
authored
[Ruleset Engine] The len() function supports arrays (#19606)
1 parent e5dcf7a commit fede2d0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/content/docs/ruleset-engine/rules-language/functions.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,11 +135,11 @@ For example, if `http.request.uri.path` is `"/welcome.html"`, then `ends_with(ht
135135
### `len`
136136

137137
{/* prettier-ignore */}
138-
<code>len(<Type text="String | Bytes" />)</code>: <Type text="Integer" />
138+
<code>len(<Type text="String | Bytes | Array" />)</code>: <Type text="Integer" />
139139

140-
Returns the byte length of a String or Bytes field.
140+
Returns the byte length of a String or Bytes value, or the number of elements in an array.
141141

142-
For example, if `http.host` is `"example.com"`, then `len(http.host)` will return `11`.
142+
For example, if the value of `http.host` is `"example.com"`, then `len(http.host)` will return `11`.
143143

144144
### `lookup_json_integer`
145145

@@ -348,7 +348,7 @@ url_decode("%2520", "r") will return " "
348348
// Using url_decode() with the any() function:
349349
any(url_decode(http.request.body.form.values[*])[*] contains "an xss attack")
350350
351-
// Using the u option to match a specific alphabet
351+
// Using the u option to match a specific alphabet
352352
url_decode(http.request.uri.path) matches "(?u)\p{Hangul}+"
353353
```
354354

0 commit comments

Comments
 (0)