We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 69fd353 commit 063c02fCopy full SHA for 063c02f
internal/ingress/annotations/customheaders/main.go
@@ -18,6 +18,7 @@ package customheaders
18
19
import (
20
"fmt"
21
+ "reflect"
22
"regexp"
23
24
"k8s.io/klog/v2"
@@ -35,6 +36,18 @@ type Config struct {
35
36
Headers map[string]string `json:"headers,omitempty"`
37
}
38
39
+// Equal tests for equality between two Config types
40
+func (c1 *Config) Equal(c2 *Config) bool {
41
+ if c1 == c2 {
42
+ return true
43
+ }
44
+ if c1 == nil || c2 == nil {
45
+ return false
46
47
+
48
+ return reflect.DeepEqual(c1.Headers, c2.Headers)
49
+}
50
51
var (
52
headerRegexp = regexp.MustCompile(`^[a-zA-Z\d\-_]+$`)
53
valueRegexp = regexp.MustCompile(`^[a-zA-Z\d_ :;.,\\/"'?!(){}\[\]@<>=\-+*#$&\x60|~^%]+$`)
0 commit comments