Skip to content

Commit 0c98860

Browse files
committed
[Ruleset Engine] Add raw.http.request.headers.* fields
1 parent d6cf423 commit 0c98860

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed

src/content/fields/index.yaml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,68 @@ entries:
455455
456456
**Note**: This raw field may include some basic normalization done by Cloudflare's HTTP server. However, this can change in the future.
457457
458+
- name: raw.http.request.headers
459+
data_type: Map<Array<String>>
460+
categories: [Request, Headers, Raw fields]
461+
keywords: [request, client, visitor, raw]
462+
summary: The HTTP request headers without any transformation represented as a Map (or associative array).
463+
description: |-
464+
This is the raw field version of the [`http.request.headers`](/ruleset-engine/rules-language/fields/reference/http.request.headers/) field. Raw fields, prefixed with `raw.`, preserve original request values for later evaluations. These fields are immutable during the entire request evaluation workflow, and they are not affected by the actions of previously matched rules.
465+
466+
When the HTTP request contains too many headers, this field may not contain all of the headers sent in the HTTP request. In this situation, the [`raw.http.request.headers.truncated`](/ruleset-engine/rules-language/fields/reference/raw.http.request.headers.truncated/) field will be set to `true`.
467+
example_value: |-
468+
{"content-type": ["application/json"]}
469+
example_block: |-
470+
any(raw.http.request.headers["content-type"][*] == "application/json")
471+
472+
- name: raw.http.request.headers.names
473+
data_type: Array<String>
474+
categories: [Request, Headers, Raw fields]
475+
keywords: [request, client, visitor, raw]
476+
summary: The names of the headers in the HTTP request without any transformation.
477+
description: |-
478+
This is the raw field version of the [`http.request.headers.names`](/ruleset-engine/rules-language/fields/reference/http.request.headers.names/) field. Raw fields, prefixed with `raw.`, preserve original request values for later evaluations. These fields are immutable during the entire request evaluation workflow, and they are not affected by the actions of previously matched rules.
479+
480+
When the HTTP request contains too many headers, this field may not contain the names of all of the headers sent in the HTTP request. In this situation, the [`raw.http.request.headers.truncated`](/ruleset-engine/rules-language/fields/reference/raw.http.request.headers.truncated/) field will be set to `true`.
481+
482+
**Note**: In HTTP/2, the names of HTTP headers are always in lowercase. Recent versions of the `curl` tool [enable HTTP/2 by default](https://curl.se/docs/manpage.html#--http2) for HTTPS connections.
483+
example_value: |-
484+
["content-type"]
485+
example_block: |-
486+
any(raw.http.request.headers.names[*] == "content-type")
487+
488+
- name: raw.http.request.headers.values
489+
data_type: Array<String>
490+
categories: [Request, Headers, Raw fields]
491+
keywords: [request, client, visitor, raw]
492+
summary: The values of the headers in the HTTP request without any transformation.
493+
description: |-
494+
This is the raw field version of the [`http.request.headers.values`](/ruleset-engine/rules-language/fields/reference/http.request.headers.values/) field. Raw fields, prefixed with `raw.`, preserve original request values for later evaluations. These fields are immutable during the entire request evaluation workflow, and they are not affected by the actions of previously matched rules.
495+
496+
When the HTTP request contains too many headers, this field may not contain the values of all of the headers sent in the HTTP request. In this situation, the [`raw.http.request.headers.truncated`](/ruleset-engine/rules-language/fields/reference/raw.http.request.headers.truncated/) field will be set to `true`.
497+
498+
**Note**: In HTTP/2, the names of HTTP headers are always in lowercase. Recent versions of the `curl` tool [enable HTTP/2 by default](https://curl.se/docs/manpage.html#--http2) for HTTPS connections.
499+
example_value: |-
500+
Example 1: ["application/json"]
501+
Example 2: ["This header value is longer than 10 bytes"]
502+
503+
example_block: |-
504+
# Example 1: Check for specific header value.
505+
any(raw.http.request.headers.values[*] == "application/json")
506+
507+
# Example 2: Match requests according to the specified operator and the length/size entered for the header value.
508+
any(len(raw.http.request.headers.values[*])[*] gt 10)
509+
510+
- name: raw.http.request.headers.truncated
511+
data_type: Boolean
512+
categories: [Request, Headers, Raw fields]
513+
keywords: [request, client, visitor, raw]
514+
summary: Indicates whether the HTTP request contains too many headers.
515+
description: |-
516+
This is the raw field version of the [`http.request.headers.truncated`](/ruleset-engine/rules-language/fields/reference/http.request.headers.truncated/) field. Raw fields, prefixed with `raw.`, preserve original request values for later evaluations. These fields are immutable during the entire request evaluation workflow, and they are not affected by the actions of previously matched rules.
517+
518+
When `true`, [`raw.http.request.headers`](/ruleset-engine/rules-language/fields/reference/raw.http.request.headers/), [`raw.http.request.headers.names`](/ruleset-engine/rules-language/fields/reference/raw.http.request.headers.names/), and [`raw.http.request.headers.values`](/ruleset-engine/rules-language/fields/reference/raw.http.request.headers.values/) may not contain all of the headers sent in the HTTP request.
519+
458520
- name: raw.http.response.headers
459521
data_type: Map<Array<String>>
460522
categories: [Response, Headers, Raw fields]

0 commit comments

Comments
 (0)