Skip to content
This repository was archived by the owner on Apr 14, 2026. It is now read-only.

Commit e8ada7a

Browse files
Fix broken code when response content is not exist, but response headers are exist in Iris strict server. (oapi-codegen#1411)
Co-authored-by: Marcin Romaszewicz <mromaszewicz@users.noreply.github.com>
1 parent 6105796 commit e8ada7a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

pkg/codegen/templates/strict/strict-iris-interface.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@
128128
{{end -}}
129129
func (response {{$opid}}{{$statusCode}}Response) Visit{{$opid}}Response(ctx iris.Context) error {
130130
{{range $headers -}}
131-
ctx.Response().Header.Set("{{.Name}}", fmt.Sprint(response.Headers.{{.GoName}}))
131+
ctx.ResponseWriter().Header().Set("{{.Name}}", fmt.Sprint(response.Headers.{{.GoName}}))
132132
{{end -}}
133133
ctx.StatusCode({{if $fixedStatusCode}}{{$statusCode}}{{else}}response.StatusCode{{end}})
134134
return nil

0 commit comments

Comments
 (0)