Skip to content

Commit 0a5580a

Browse files
committed
Use a pattern instead of a CEL to validate HTTP header values
Signed-off-by: Norwin Schnyder <[email protected]>
1 parent 07adceb commit 0a5580a

File tree

6 files changed

+42
-191
lines changed

6 files changed

+42
-191
lines changed

apis/v1/httproute_types.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,7 @@ type HTTPHeaderMatch struct {
619619
//
620620
// +kubebuilder:validation:MinLength=1
621621
// +kubebuilder:validation:MaxLength=4096
622-
// <gateway:experimental:validation:XValidation:message="must only contain printable ASCII characters, optionally separated by single tabs or spaces",rule="self.matches('^[!-~]+([\\t ]?[!-~]+)*$')">
622+
// <gateway:experimental:validation:Pattern=`^[!-~]+([\t ]?[!-~]+)*$`>
623623
Value string `json:"value"`
624624
}
625625

@@ -993,7 +993,7 @@ type HTTPHeader struct {
993993
//
994994
// +kubebuilder:validation:MinLength=1
995995
// +kubebuilder:validation:MaxLength=4096
996-
// <gateway:experimental:validation:XValidation:message="must only contain printable ASCII characters, optionally separated by single tabs or spaces",rule="self.matches('^[!-~]+([\\t ]?[!-~]+)*$')">
996+
// <gateway:experimental:validation:Pattern=`^[!-~]+([\t ]?[!-~]+)*$`>
997997
Value string `json:"value"`
998998
}
999999

config/crd/experimental/gateway.networking.k8s.io_grpcroutes.yaml

+8-40
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)