From 579ad04a6d0ccd9181510c9182cbb59f1c0363ef Mon Sep 17 00:00:00 2001 From: Raphael Simon Date: Sat, 17 Feb 2024 16:59:45 -0800 Subject: [PATCH] Protect against invalid route captures --- expr/http_endpoint.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/expr/http_endpoint.go b/expr/http_endpoint.go index 9f84995116..774a3a9f78 100644 --- a/expr/http_endpoint.go +++ b/expr/http_endpoint.go @@ -131,6 +131,9 @@ func (e *HTTPEndpointExpr) PathParams() *MappedAttributeExpr { for _, r := range e.Routes { for _, p := range r.Params() { att := pat.Find(p) + if att == nil { + continue + } obj.Set(p, att) if e.Params.IsRequired(p) { v.AddRequired(p)