@marcel91200 / caddy Mirror · read-only / commits / b301a3df
Fork 0

Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS

Mirrored from https://github.com/Slazee/caddy.git

Synced Nov 13, 04:15 UTC

celmatcher: Implement `pkix.Name` conversion to string (#5492)

Francis Lavoie committed Apr 19, 2023 at 11:55 UTC b301a3df70232fe00de186b0586dcec8bf0d2559
1 file changed +4 -1
modules/caddyhttp/celmatcher.go
+4 -1
@@ -255,7 +255,10 @@ type celPkixName struct{ *pkix.Name }
255 func (pn celPkixName) ConvertToNative(typeDesc reflect.Type) (any, error) {
256 return pn.Name, nil
257 }
258 -func (celPkixName) ConvertToType(typeVal ref.Type) ref.Val {
258 +func (pn celPkixName) ConvertToType(typeVal ref.Type) ref.Val {
259 + if typeVal.TypeName() == "string" {
260 + return types.String(pn.Name.String())
261 + }
262 panic("not implemented")
263 }
264 func (pn celPkixName) Equal(other ref.Val) ref.Val {