-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Ruleset Engine] Review examples for request body fields #19118
Merged
pedrosousa
merged 6 commits into
production
from
pedro/2025-01-10-ruleset-engine-add-content-disposition-expression-example
Jan 10, 2025
+181
−150
Merged
Changes from 3 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
c19a70d
[Ruleset Engine] Add example to multipart.content_dispositions field
pedrosousa bc1080c
Fix example value
pedrosousa 82ed284
Update expression examples (request body fields)
pedrosousa 91fea4d
Fix field example value
pedrosousa 4d584dd
Clarify usage examples
pedrosousa ac190f9
Clarify example usage and example value in other pages
pedrosousa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,15 +72,14 @@ The return value may be truncated if [`http.request.body.truncated`](#httpreques | |
- **Whitespace:** preserved | ||
- **Non-ASCII:** preserved | ||
|
||
Example: | ||
|
||
```txt | ||
any(http.request.body.form["username"][*] == "admin") | ||
``` | ||
|
||
Example value: | ||
|
||
`{username": ["admin"]}` | ||
pedrosousa marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
Example: | ||
|
||
`any(http.request.body.form["username"][*] == "admin")` | ||
|
||
## `http.request.body.form.names` | ||
|
||
`http.request.body.form.names` <Type text='Array<String>' /> | ||
|
@@ -97,16 +96,14 @@ The return value may be truncated if [`http.request.body.truncated`](#httpreques | |
- **Whitespace:** preserved | ||
- **Non-ASCII:** preserved | ||
|
||
Example: | ||
|
||
```txt | ||
any(http.request.body.form.names[*] == "username") | ||
``` | ||
|
||
Example value: | ||
|
||
`["username"]` | ||
|
||
Example: | ||
|
||
`any(http.request.body.form.names[*] == "username")` | ||
|
||
## `http.request.body.form.values` | ||
|
||
`http.request.body.form.values` <Type text='Array<String>' /> | ||
|
@@ -123,16 +120,14 @@ The return value may be truncated if [`http.request.body.truncated`](#httpreques | |
- **Whitespace:** preserved | ||
- **Non-ASCII:** preserved | ||
|
||
Example: | ||
|
||
```txt | ||
any(http.request.body.form.values[*] == "admin") | ||
``` | ||
|
||
Example value: | ||
|
||
`["admin"]` | ||
|
||
Example: | ||
|
||
`any(http.request.body.form.values[*] == "admin")` | ||
|
||
## `http.request.body.mime` | ||
|
||
`http.request.body.mime` <Type text='String' /> | ||
|
@@ -141,9 +136,13 @@ The MIME type of the request detected from the request body. | |
|
||
Supports the most common MIME types of the following general categories: video, audio, image, application, text. | ||
|
||
Example value: | ||
|
||
`"image/jpeg"` | ||
|
||
Example: | ||
|
||
`image/jpeg` | ||
`http.request.body.mime in {"image/bmp" "image/gif" "image/jpeg" "image/png" "image/tiff"}` | ||
|
||
This field is available on all Cloudflare plans. | ||
|
||
|
@@ -155,7 +154,11 @@ A Map (or associative array) representation of multipart names to multipart valu | |
|
||
Example value: | ||
|
||
`{"username": ["alice_doe"], "picture": [<binary_content_of_file>]}` | ||
`{"username": ["alice_doe"], "role": ["editor"], "picture": [<binary_content_of_file>]}` | ||
|
||
Example: | ||
|
||
`any(http.request.body.multipart["role"][*] == "admin")` | ||
|
||
## `http.request.body.multipart.names` | ||
|
||
|
@@ -181,6 +184,10 @@ Example value: | |
|
||
`["alice_doe", <binary_content_of_file>]` | ||
|
||
Example: | ||
|
||
`any(http.request.body.multipart.values[*] == "alice_doe")` | ||
|
||
## `http.request.body.multipart.content_types` | ||
|
||
`http.request.body.multipart.content_types` <Type text='Array<Array<String>>' /> | ||
|
@@ -203,7 +210,11 @@ List of `Content-Disposition` headers for each part in the multipart body. | |
|
||
Example value: | ||
|
||
`[["form-data; name=\"username\"], ["form-data;name=\"picture\"]]` | ||
`[["form-data; name=\"username\""], ["form-data; name=\"picture\""]]` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed example value (missing double quotes). |
||
|
||
Example: | ||
|
||
`any(http.request.body.multipart.content_dispositions[*][0] in {"form-data; name=\"username\"" "form-data; name=\"picture\""})` | ||
|
||
## `http.request.body.multipart.content_transfer_encodings` | ||
|
||
|
@@ -213,7 +224,11 @@ List of `Content-Transfer-Encoding` headers for each part in the multipart body. | |
|
||
Example value: | ||
|
||
`[["quoted-printable"], ["quoted-printable"]]` | ||
`[["quoted-printable"], ["base64"]]` | ||
|
||
Example: | ||
|
||
`any(http.request.body.multipart.content_transfer_encodings[*][0] == "binary")` | ||
|
||
## `http.request.body.multipart.filenames` | ||
|
||
|
@@ -224,3 +239,7 @@ List of filenames for each part in the multipart body. | |
Example value: | ||
|
||
`[["file1.txt"], ["photo.jpg"]]` | ||
|
||
Example: | ||
|
||
`any(http.request.body.multipart.filenames[*][0] in {"token.txt" "password.txt"})` |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved below the example value.