Skip to content

Commit 29e348b

Browse files
maxvpsdnts
authored andcommitted
[Gateway] Non-Latin character limitation (cloudflare#23078)
1 parent 35a467a commit 29e348b

File tree

5 files changed

+40
-18
lines changed

5 files changed

+40
-18
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/docs/cloudflare-one/policies/gateway/lists.mdx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,13 @@ Your lists can include up to 1,000 entries for Standard plans and 5,000 for Ente
4747

4848
Hostname lists do not support wildcard entries. You will need to add domains as exact matches. Adding a wildcard to lists comprised of hostnames will return an error when you save.
4949

50+
### Non-Latin characters
51+
52+
Gateway supports non-Latin characters by converting all domains and hostnames to [Punycode](https://www.rfc-editor.org/rfc/rfc3492.txt). Once you save a list with non-Latin characters, Gateway will display the entry as Punycode.
53+
5054
### Duplicate entries
5155

52-
Lists cannot have duplicate entries. Because hostnames are converted to [Punycode](https://www.rfc-editor.org/rfc/rfc3492.txt), multiple list entries that convert to the same string will count as duplicates. For example, `éxàmple.com` converts to `xn—xmple-rqa5d.com`, so including both `éxàmple.com` and `xn—xmple-rqa5d.com` in a list will result in a duplicate error.
56+
Lists cannot have duplicate entries. Because domains and hostnames are converted to [Punycode](#non-latin-characters), multiple list entries that convert to the same string will count as duplicates. For example, `éxàmple.com` converts to `xn—xmple-rqa5d.com`, so including both `éxàmple.com` and `xn—xmple-rqa5d.com` in a list will result in a duplicate error.
5357

5458
### URL slashes
5559

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

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,15 @@ params:
33
- APIendpoint
44
---
55

6+
import { Render } from "~/components";
7+
68
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`.
79

8-
| UI name | API example | Evaluation phase |
9-
| ------- | ------------------------------------------------- | --------------------- |
10-
| Domain | <code>any({props.APIendpoint}[*] in \{1\})</code> | Before DNS resolution |
10+
| UI name | API example | Evaluation phase |
11+
| ------- | --------------------------------------------------------- | --------------------- |
12+
| Domain | <code>any({props.APIendpoint}[*] == "example.com")</code> | Before DNS resolution |
13+
14+
<Render
15+
file="gateway/selectors/non-latin-characters"
16+
params={{ inputType: "domain" }}
17+
/>

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,19 @@ params:
33
- APIendpoint
44
---
55

6+
import { Render } from "~/components";
7+
68
Use this selector to match against only the hostname specified. For example, you can match `test.example.com` but not `example.com` or `www.test.example.com`.
79

810
| UI name | API example | Evaluation phase |
911
| ------- | --------------------------------------------------- | --------------------- |
1012
| Host | <code>{props.APIendpoint} == \"example.com\"</code> | Before DNS resolution |
13+
14+
<Render
15+
file="gateway/selectors/non-latin-characters"
16+
params={{ inputType: "hostname" }}
17+
/>
18+
19+
:::note
20+
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.
21+
:::
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
params:
3+
- inputType
4+
---
5+
6+
Gateway policies do not support {props.inputType}s with non-Latin characters directly. To use a {props.inputType} with non-Latin characters, add it to a [list](/cloudflare-one/policies/gateway/lists/).

0 commit comments

Comments
 (0)