Cloudflare 中文文档
Firewall Rules
编辑这个页面
跳转官方原文档
Set theme to dark (⇧+D)

Expression validation

The Cloudflare Filters API supports an endpoint for validating expressions.

Operation Method + Endpoint Notes
Validate expression via query string
(?expression=)
GET /filters/validate-expr Allows testing and validating expressions without changing your configuration.
Validate expression via JSON object POST /filters/validate-expr Allows testing and validating expressions without changing your configuration.

​​ Examples

​​ Validate expression via query string

Note the validation error in the response. In this example, the error is due to an invalid IP address format:

​​ Validate expression via JSON object

Note the validation error in the response. In this example, the value for the subnet mask, /2000, is not a valid IPv6 CIDR mask: