Skip to content

Commit

Permalink
fix(gin-template): Respect ctx.Abort() (oapi-codegen#914)
Browse files Browse the repository at this point in the history
Respect when c.Abort() is called in a middleware func.
  • Loading branch information
alexstojda committed Jan 18, 2023
1 parent 7af38fb commit e1c15f2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/codegen/templates/gin/gin-wrappers.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,9 @@ func (siw *ServerInterfaceWrapper) {{$opid}}(c *gin.Context) {

for _, middleware := range siw.HandlerMiddlewares {
middleware(c)
if c.isAborted() {
return
}
}

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

0 comments on commit e1c15f2

Please sign in to comment.