From d14917d7b89e60282df77db7475b4c2d4a6555dd Mon Sep 17 00:00:00 2001 From: Borja Lazaro Toralles Date: Wed, 30 Nov 2022 14:17:25 +0000 Subject: [PATCH] Fixes missing sanitation of context key variable in gorilla server --- pkg/codegen/templates/gorilla/gorilla-middleware.tmpl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkg/codegen/templates/gorilla/gorilla-middleware.tmpl b/pkg/codegen/templates/gorilla/gorilla-middleware.tmpl index a72713b3a..5150186b0 100644 --- a/pkg/codegen/templates/gorilla/gorilla-middleware.tmpl +++ b/pkg/codegen/templates/gorilla/gorilla-middleware.tmpl @@ -40,7 +40,7 @@ func (siw *ServerInterfaceWrapper) {{$opid}}(w http.ResponseWriter, r *http.Requ {{end}} {{range .SecurityDefinitions}} - ctx = context.WithValue(ctx, {{.ProviderName | ucFirst}}Scopes, {{toStringArray .Scopes}}) + ctx = context.WithValue(ctx, {{.ProviderName | sanitizeGoIdentity | ucFirst}}Scopes, {{toStringArray .Scopes}}) {{end}} {{if .RequiresParamObject}} @@ -253,4 +253,3 @@ type TooManyValuesForParamError struct { func (e *TooManyValuesForParamError) Error() string { return fmt.Sprintf("Expected one value for %s, got %d", e.ParamName, e.Count) } -