Skip to content

Commit 61a53c3

Browse files
pedrosousaelithrar
authored andcommitted
[Ruleset Engine] Add body multipart fields (#16563)
1 parent e432069 commit 61a53c3

File tree

1 file changed

+79
-1
lines changed

1 file changed

+79
-1
lines changed

src/content/docs/ruleset-engine/rules-language/fields/http-request-body.mdx

Lines changed: 79 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ This field may have a value larger than the one returned by `len(http.request.bo
5656

5757
## `http.request.body.form`
5858

59-
`http.request.body.form` `Map<Array>String>>`
59+
`http.request.body.form` `Map<Array<String>>`
6060

6161
Represents the HTTP request body of a form as a Map (or associative array). Populated when the Content-Type header is `application/x-www-form-urlencoded`.
6262

@@ -144,3 +144,81 @@ Example:
144144
`image/jpeg`
145145

146146
This field is available on all Cloudflare plans.
147+
148+
## `http.request.body.multipart`
149+
150+
`http.request.body.multipart` `Map<Array<String>>`
151+
152+
A Map (or associative array) of multipart names to multipart values in the request body.
153+
154+
Example value:
155+
156+
`{"username": ["alice_doe"], "picture": [<binary_content_of_file>]}`
157+
158+
## `http.request.body.multipart.names`
159+
160+
`http.request.body.multipart.names` `Array<Array<String>>`
161+
162+
List of multipart names for every part in the multipart body.
163+
164+
Example value:
165+
166+
`[["username"], ["picture"]]`
167+
168+
Example:
169+
170+
`any(http.request.body.multipart.names[*][0] == "picture")`
171+
172+
## `http.request.body.multipart.values`
173+
174+
`http.request.body.multipart.values` `Array<String>`
175+
176+
List of multipart values for every part in the multipart body.
177+
178+
Example value:
179+
180+
`["alice_doe", <binary_content_of_file>]`
181+
182+
## `http.request.body.multipart.content_types`
183+
184+
`http.request.body.multipart.content_types` `Array<Array<String>>`
185+
186+
List of `Content-Type` headers for each part in the multipart body.
187+
188+
Example value:
189+
190+
`[["text/plain"], ["image/jpeg"]]`
191+
192+
Example:
193+
194+
`any(http.request.body.multipart.content_types[*][0] == "application/octet-stream")`
195+
196+
## `http.request.body.multipart.content_dispositions`
197+
198+
`http.request.body.multipart.content_dispositions` `Array<Array<String>>`
199+
200+
List of `Content-Disposition` headers for each part in the multipart body.
201+
202+
Example value:
203+
204+
`[["form-data; name=\"username\"], ["form-data;name=\"picture\"]]`
205+
206+
## `http.request.body.multipart.content_transfer_encodings`
207+
208+
`http.request.body.multipart.content_transfer_encodings` `Array<Array<String>>`
209+
210+
List of `Content-Transfer-Encoding` headers for each part in the multipart body.
211+
212+
Example value:
213+
214+
`[["quoted-printable"], ["quoted-printable"]]`
215+
216+
## `http.request.body.multipart.filenames`
217+
218+
`http.request.body.multipart.filenames` `Array<Array<String>>`
219+
220+
List of filenames for each part in the multipart body.
221+
222+
Example value:
223+
224+
`[["file1.txt"], ["photo.jpg"]]`

0 commit comments

Comments
 (0)