From 41aa4479f18527c7e6dccf2e7ace7441e0307502 Mon Sep 17 00:00:00 2001 From: Wim Vander Schelden <88655602+wvdschel-f3@users.noreply.github.com> Date: Thu, 14 Apr 2022 12:57:32 +0200 Subject: [PATCH] Fix reference to undefined variable in gin codegen --- pkg/codegen/templates/gin/gin-wrappers.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/codegen/templates/gin/gin-wrappers.tmpl b/pkg/codegen/templates/gin/gin-wrappers.tmpl index 6eb787c09..27bf19c95 100644 --- a/pkg/codegen/templates/gin/gin-wrappers.tmpl +++ b/pkg/codegen/templates/gin/gin-wrappers.tmpl @@ -77,7 +77,7 @@ func (siw *ServerInterfaceWrapper) {{$opid}}(c *gin.Context) { {{end}} {{if .HeaderParams}} - headers := r.Header + headers := c.Request.Header {{range .HeaderParams}}// ------------- {{if .Required}}Required{{else}}Optional{{end}} header parameter "{{.ParamName}}" ------------- if valueList, found := headers[http.CanonicalHeaderKey("{{.ParamName}}")]; found {