MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / stringifyValue

Method stringifyValue

internal/waf/rule.go:841–861  ·  view source on GitHub ↗
(value any)

Source from the content-addressed store, hash-verified

839}
840
841func (this *Rule) stringifyValue(value any) string {
842 if value == nil {
843 return ""
844 }
845 switch v := value.(type) {
846 case string:
847 return v
848 case []string:
849 return strings.Join(v, "")
850 case []byte:
851 return string(v)
852 case [][]byte:
853 var b = &bytes.Buffer{}
854 for _, vb := range v {
855 b.Write(vb)
856 }
857 return b.String()
858 default:
859 return types.String(v)
860 }
861}

Callers 3

MatchRequestMethod · 0.95
MatchResponseMethod · 0.95
TestMethod · 0.95

Calls 2

WriteMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected