From ee6618e8319cdd1faeb59fbd15cc8772875ef73b Mon Sep 17 00:00:00 2001 From: Mark Smith Date: Thu, 24 Oct 2019 18:48:56 +0100 Subject: [PATCH] reset p.values to echo.maxParam (#1429) * reset p.values to echo.maxParam * Update context.go How about just reset the values? --- context.go | 4 +++- go.sum | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/context.go b/context.go index e0f4cc00..b6d38232 100644 --- a/context.go +++ b/context.go @@ -609,5 +609,7 @@ func (c *context) Reset(r *http.Request, w http.ResponseWriter) { c.path = "" c.pnames = nil // NOTE: Don't reset because it has to have length c.echo.maxParam at all times - // c.pvalues = nil + for i := 0; i < *c.echo.maxParam; i++ { + c.pvalues[i] = "" + } } diff --git a/go.sum b/go.sum index 5aedb2e2..d679f740 100644 --- a/go.sum +++ b/go.sum @@ -26,6 +26,7 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a h1:aYOabOQFp6Vj6W1F80affTUvO9UxmJRx8K0gsfABByQ= golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=