Skip to content

Commit

Permalink
[Ruleset Engine] Add body multipart fields (#16563)
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrosousa authored Sep 20, 2024
1 parent 84bab1e commit 5a4b7f8
Showing 1 changed file with 79 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ This field may have a value larger than the one returned by `len(http.request.bo

## `http.request.body.form`

`http.request.body.form` `Map<Array>String>>`
`http.request.body.form` `Map<Array<String>>`

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`.

Expand Down Expand Up @@ -144,3 +144,81 @@ Example:
`image/jpeg`

This field is available on all Cloudflare plans.

## `http.request.body.multipart`

`http.request.body.multipart` `Map<Array<String>>`

A Map (or associative array) of multipart names to multipart values in the request body.

Example value:

`{"username": ["alice_doe"], "picture": [<binary_content_of_file>]}`

## `http.request.body.multipart.names`

`http.request.body.multipart.names` `Array<Array<String>>`

List of multipart names for every part in the multipart body.

Example value:

`[["username"], ["picture"]]`

Example:

`any(http.request.body.multipart.names[*][0] == "picture")`

## `http.request.body.multipart.values`

`http.request.body.multipart.values` `Array<String>`

List of multipart values for every part in the multipart body.

Example value:

`["alice_doe", <binary_content_of_file>]`

## `http.request.body.multipart.content_types`

`http.request.body.multipart.content_types` `Array<Array<String>>`

List of `Content-Type` headers for each part in the multipart body.

Example value:

`[["text/plain"], ["image/jpeg"]]`

Example:

`any(http.request.body.multipart.content_types[*][0] == "application/octet-stream")`

## `http.request.body.multipart.content_dispositions`

`http.request.body.multipart.content_dispositions` `Array<Array<String>>`

List of `Content-Disposition` headers for each part in the multipart body.

Example value:

`[["form-data; name=\"username\"], ["form-data;name=\"picture\"]]`

## `http.request.body.multipart.content_transfer_encodings`

`http.request.body.multipart.content_transfer_encodings` `Array<Array<String>>`

List of `Content-Transfer-Encoding` headers for each part in the multipart body.

Example value:

`[["quoted-printable"], ["quoted-printable"]]`

## `http.request.body.multipart.filenames`

`http.request.body.multipart.filenames` `Array<Array<String>>`

List of filenames for each part in the multipart body.

Example value:

`[["file1.txt"], ["photo.jpg"]]`

0 comments on commit 5a4b7f8

Please sign in to comment.