Skip to content

Commit 21b7a5a

Browse files
alexstojdadanicc097
authored andcommitted
fix(gin-template): Respect ctx.Abort() (oapi-codegen#914)
Respect when c.Abort() is called in a middleware func.
1 parent 3c27092 commit 21b7a5a

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

pkg/codegen/templates/gin/gin-wrappers.tmpl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,9 @@ func (siw *ServerInterfaceWrapper) {{$opid}}(c *gin.Context) {
176176

177177
for _, middleware := range siw.HandlerMiddlewares {
178178
middleware(c)
179+
if c.isAborted() {
180+
return
181+
}
179182
}
180183

181184
siw.Handler.{{.OperationId}}(c{{genParamNames .PathParams}}{{if .RequiresParamObject}}, params{{end}})

0 commit comments

Comments
 (0)