Skip to content

Commit ecfe5d2

Browse files
committed
Update HTTP policies and partials
1 parent 8c0b323 commit ecfe5d2

File tree

3 files changed

+15
-17
lines changed

3 files changed

+15
-17
lines changed

src/content/docs/cloudflare-one/policies/gateway/http-policies/index.mdx

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -446,11 +446,10 @@ Only applies to traffic sent through the [WARP client](/cloudflare-one/connectio
446446

447447
### Domain
448448

449-
Use this selector to match against a domain and all subdomains -- for example, if you want to block `example.com` and subdomains such as `www.example.com`.
450-
451-
| UI name | API example |
452-
| ------- | -------------------------------------------- |
453-
| Domain | `any(http.conn.domains[*] == "example.com")` |
449+
<Render
450+
file="gateway/selectors/domain"
451+
params={{ APIendpoint: "http.conn.domains" }}
452+
/>
454453

455454
### Download and Upload File Size
456455

@@ -549,15 +548,10 @@ Scans HTTP traffic for the presence of social security numbers and other PII. Yo
549548

550549
### Host
551550

552-
Use this selector to match only the hostname specified -- for example, if you want to block `test.example.com` but not `example.com` or `www.test.example.com`.
553-
554-
| UI name | API example |
555-
| ------- | ------------------------------------------ |
556-
| Host | `http.conn.hostname == "test.example.com"` |
557-
558-
:::note
559-
Some hostnames (`example.com`) will invisibly redirect to the www subdomain (`www.example.com`). To match this type of website, use the [Domain](#domain) selector instead of the Host selector.
560-
:::
551+
<Render
552+
file="gateway/selectors/host"
553+
params={{ APIendpoint: "http.conn.hostname" }}
554+
/>
561555

562556
### HTTP Method
563557

src/content/partials/cloudflare-one/gateway/selectors/domain.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ params:
55

66
Use this selector to match against a domain and all subdomains. For example, you can match `example.com` and its subdomains, such as `www.example.com`.
77

8-
| UI name | API example | Evaluation phase |
9-
| ------- | ------------------------------------------------- | --------------------- |
10-
| Domain | <code>any({props.APIendpoint}[*] in \{1\})</code> | Before DNS resolution |
8+
| UI name | API example | Evaluation phase |
9+
| ------- | --------------------------------------------------------- | --------------------- |
10+
| Domain | <code>any({props.APIendpoint}[*] == "example.com")</code> | Before DNS resolution |

src/content/partials/cloudflare-one/gateway/selectors/host.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,7 @@ Use this selector to match against only the hostname specified. For example, you
88
| UI name | API example | Evaluation phase |
99
| ------- | --------------------------------------------------- | --------------------- |
1010
| Host | <code>{props.APIendpoint} == \"example.com\"</code> | Before DNS resolution |
11+
12+
:::note
13+
Some hostnames (`example.com`) will invisibly redirect to the www subdomain (`www.example.com`). To match this type of website, use the [Domain](#domain) selector instead of the Host selector.
14+
:::

0 commit comments

Comments
 (0)